Location: PHPKode > projects > PEL: PHP Exif Library > pel-0.9.1/doc/__filesource/fsource_PEL__PelConvert.php.html
<?xml version="1.0" encoding="iso-8859-1"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
  <html xmlns="http://www.w3.org/1999/xhtml">
		<head>
			<!-- template designed by Marco Von Ballmoos -->
			<title>File Source for PelConvert.php</title>
			<link rel="stylesheet" href="../media/stylesheet.css" />
			<meta http-equiv='Content-Type' content='text/html; charset=iso-8859-1'/>
		</head>
		<body>
						<h1>Source for file PelConvert.php</h1>
<p>Documentation is available at <a href="../PEL/_PelConvert.php.html">PelConvert.php</a></p>
<div class="src-code">
<div class="src-code"><ol><li><div class="src-line"><a name="a1"></a><span class="src-php">&lt;?php</span></div></li>
<li><div class="src-line"><a name="a2"></a>&nbsp;</div></li>
<li><div class="src-line"><a name="a3"></a><span class="src-comm">/*&nbsp;&nbsp;PEL:&nbsp;PHP&nbsp;Exif&nbsp;Library.&nbsp;&nbsp;A&nbsp;library&nbsp;with&nbsp;support&nbsp;for&nbsp;reading&nbsp;and</span></div></li>
<li><div class="src-line"><a name="a4"></a><span class="src-comm">&nbsp;*&nbsp;&nbsp;writing&nbsp;all&nbsp;Exif&nbsp;headers&nbsp;in&nbsp;JPEG&nbsp;and&nbsp;TIFF&nbsp;images&nbsp;using&nbsp;PHP.</span></div></li>
<li><div class="src-line"><a name="a5"></a><span class="src-comm">&nbsp;*</span></div></li>
<li><div class="src-line"><a name="a6"></a><span class="src-comm">&nbsp;*&nbsp;&nbsp;Copyright&nbsp;(C)&nbsp;2004,&nbsp;2005&nbsp;&nbsp;Martin&nbsp;Geisler.</span></div></li>
<li><div class="src-line"><a name="a7"></a><span class="src-comm">&nbsp;*</span></div></li>
<li><div class="src-line"><a name="a8"></a><span class="src-comm">&nbsp;*&nbsp;&nbsp;This&nbsp;program&nbsp;is&nbsp;free&nbsp;software;&nbsp;you&nbsp;can&nbsp;redistribute&nbsp;it&nbsp;and/or&nbsp;modify</span></div></li>
<li><div class="src-line"><a name="a9"></a><span class="src-comm">&nbsp;*&nbsp;&nbsp;it&nbsp;under&nbsp;the&nbsp;terms&nbsp;of&nbsp;the&nbsp;GNU&nbsp;General&nbsp;Public&nbsp;License&nbsp;as&nbsp;published&nbsp;by</span></div></li>
<li><div class="src-line"><a name="a10"></a><span class="src-comm">&nbsp;*&nbsp;&nbsp;the&nbsp;Free&nbsp;Software&nbsp;Foundation;&nbsp;either&nbsp;version&nbsp;2&nbsp;of&nbsp;the&nbsp;License,&nbsp;or</span></div></li>
<li><div class="src-line"><a name="a11"></a><span class="src-comm">&nbsp;*&nbsp;&nbsp;(at&nbsp;your&nbsp;option)&nbsp;any&nbsp;later&nbsp;version.</span></div></li>
<li><div class="src-line"><a name="a12"></a><span class="src-comm">&nbsp;*</span></div></li>
<li><div class="src-line"><a name="a13"></a><span class="src-comm">&nbsp;*&nbsp;&nbsp;This&nbsp;program&nbsp;is&nbsp;distributed&nbsp;in&nbsp;the&nbsp;hope&nbsp;that&nbsp;it&nbsp;will&nbsp;be&nbsp;useful,</span></div></li>
<li><div class="src-line"><a name="a14"></a><span class="src-comm">&nbsp;*&nbsp;&nbsp;but&nbsp;WITHOUT&nbsp;ANY&nbsp;WARRANTY;&nbsp;without&nbsp;even&nbsp;the&nbsp;implied&nbsp;warranty&nbsp;of</span></div></li>
<li><div class="src-line"><a name="a15"></a><span class="src-comm">&nbsp;*&nbsp;&nbsp;MERCHANTABILITY&nbsp;or&nbsp;FITNESS&nbsp;FOR&nbsp;A&nbsp;PARTICULAR&nbsp;PURPOSE.&nbsp;&nbsp;See&nbsp;the</span></div></li>
<li><div class="src-line"><a name="a16"></a><span class="src-comm">&nbsp;*&nbsp;&nbsp;GNU&nbsp;General&nbsp;Public&nbsp;License&nbsp;for&nbsp;more&nbsp;details.</span></div></li>
<li><div class="src-line"><a name="a17"></a><span class="src-comm">&nbsp;*</span></div></li>
<li><div class="src-line"><a name="a18"></a><span class="src-comm">&nbsp;*&nbsp;&nbsp;You&nbsp;should&nbsp;have&nbsp;received&nbsp;a&nbsp;copy&nbsp;of&nbsp;the&nbsp;GNU&nbsp;General&nbsp;Public&nbsp;License</span></div></li>
<li><div class="src-line"><a name="a19"></a><span class="src-comm">&nbsp;*&nbsp;&nbsp;along&nbsp;with&nbsp;this&nbsp;program&nbsp;in&nbsp;the&nbsp;file&nbsp;COPYING;&nbsp;if&nbsp;not,&nbsp;write&nbsp;to&nbsp;the</span></div></li>
<li><div class="src-line"><a name="a20"></a><span class="src-comm">&nbsp;*&nbsp;&nbsp;Free&nbsp;Software&nbsp;Foundation,&nbsp;Inc.,&nbsp;51&nbsp;Franklin&nbsp;St,&nbsp;Fifth&nbsp;Floor,</span></div></li>
<li><div class="src-line"><a name="a21"></a><span class="src-comm">&nbsp;*&nbsp;&nbsp;Boston,&nbsp;MA&nbsp;02110-1301&nbsp;USA</span></div></li>
<li><div class="src-line"><a name="a22"></a><span class="src-comm">&nbsp;*/</span></div></li>
<li><div class="src-line"><a name="a23"></a>&nbsp;</div></li>
<li><div class="src-line"><a name="a24"></a><span class="src-doc">/*&nbsp;$Id:&nbsp;PelConvert.php&nbsp;387&nbsp;2005-10-05&nbsp;11:02:52Z&nbsp;mgeisler&nbsp;$&nbsp;*/</span></div></li>
<li><div class="src-line"><a name="a25"></a>&nbsp;</div></li>
<li><div class="src-line"><a name="a26"></a>&nbsp;</div></li>
<li><div class="src-line"><a name="a27"></a><span class="src-doc">/**</span></div></li>
<li><div class="src-line"><a name="a28"></a><span class="src-doc">&nbsp;*&nbsp;Routines&nbsp;for&nbsp;converting&nbsp;back&nbsp;and&nbsp;forth&nbsp;between&nbsp;bytes&nbsp;and&nbsp;integers.</span></div></li>
<li><div class="src-line"><a name="a29"></a><span class="src-doc">&nbsp;*</span></div></li>
<li><div class="src-line"><a name="a30"></a><span class="src-doc">&nbsp;*&nbsp;</span><span class="src-doc-coretag">@author</span><span class="src-doc">&nbsp;Martin&nbsp;Geisler&nbsp;&lt;hide@address.com&gt;</span></div></li>
<li><div class="src-line"><a name="a31"></a><span class="src-doc">&nbsp;*&nbsp;</span><span class="src-doc-coretag">@version</span><span class="src-doc">&nbsp;$Revision:&nbsp;387&nbsp;$</span></div></li>
<li><div class="src-line"><a name="a32"></a><span class="src-doc">&nbsp;*&nbsp;</span><span class="src-doc-tag">@date</span><span class="src-doc">&nbsp;$Date:&nbsp;2005-10-05&nbsp;13:02:52&nbsp;+0200&nbsp;(Wed,&nbsp;05&nbsp;Oct&nbsp;2005)&nbsp;$</span></div></li>
<li><div class="src-line"><a name="a33"></a><span class="src-doc">&nbsp;*&nbsp;</span><span class="src-doc-coretag">@license</span><span class="src-doc">&nbsp;http://www.gnu.org/licenses/gpl.html&nbsp;GNU&nbsp;General&nbsp;Public</span></div></li>
<li><div class="src-line"><a name="a34"></a><span class="src-doc">&nbsp;*&nbsp;&nbsp;License&nbsp;(GPL)</span></div></li>
<li><div class="src-line"><a name="a35"></a><span class="src-doc">&nbsp;*&nbsp;</span><span class="src-doc-coretag">@package</span><span class="src-doc">&nbsp;PEL</span></div></li>
<li><div class="src-line"><a name="a36"></a><span class="src-doc">&nbsp;*/</span></div></li>
<li><div class="src-line"><a name="a37"></a>&nbsp;</div></li>
<li><div class="src-line"><a name="a38"></a><span class="src-doc">/**</span></div></li>
<li><div class="src-line"><a name="a39"></a><span class="src-doc">&nbsp;*&nbsp;Conversion&nbsp;functions&nbsp;to&nbsp;and&nbsp;from&nbsp;bytes&nbsp;and&nbsp;integers.</span></div></li>
<li><div class="src-line"><a name="a40"></a><span class="src-doc">&nbsp;*</span></div></li>
<li><div class="src-line"><a name="a41"></a><span class="src-doc">&nbsp;*&nbsp;The&nbsp;functions&nbsp;found&nbsp;in&nbsp;this&nbsp;class&nbsp;are&nbsp;used&nbsp;to&nbsp;convert&nbsp;bytes&nbsp;into</span></div></li>
<li><div class="src-line"><a name="a42"></a><span class="src-doc">&nbsp;*&nbsp;integers&nbsp;of&nbsp;several&nbsp;sizes&nbsp;(</span><span class="src-doc-inlinetag">{@link&nbsp;bytesToShort}</span><span class="src-doc">,&nbsp;</span><span class="src-doc-inlinetag">{@link&nbsp;}</span></div></li>
<li><div class="src-line"><a name="a43"></a><span class="src-doc">&nbsp;*&nbsp;bytesToLong},&nbsp;and&nbsp;</span><span class="src-doc-inlinetag">{@link&nbsp;bytesToRational}</span><span class="src-doc">)&nbsp;and&nbsp;convert&nbsp;integers&nbsp;of</span></div></li>
<li><div class="src-line"><a name="a44"></a><span class="src-doc">&nbsp;*&nbsp;several&nbsp;sizes&nbsp;into&nbsp;bytes&nbsp;(</span><span class="src-doc-inlinetag">{@link&nbsp;shortToBytes}</span><span class="src-doc">&nbsp;and&nbsp;</span><span class="src-doc-inlinetag">{@link&nbsp;}</span></div></li>
<li><div class="src-line"><a name="a45"></a><span class="src-doc">&nbsp;*&nbsp;longToBytes}).</span></div></li>
<li><div class="src-line"><a name="a46"></a><span class="src-doc">&nbsp;*</span></div></li>
<li><div class="src-line"><a name="a47"></a><span class="src-doc">&nbsp;*&nbsp;All&nbsp;the&nbsp;methods&nbsp;are&nbsp;static&nbsp;and&nbsp;they&nbsp;all&nbsp;rely&nbsp;on&nbsp;an&nbsp;argument&nbsp;that</span></div></li>
<li><div class="src-line"><a name="a48"></a><span class="src-doc">&nbsp;*&nbsp;specifies&nbsp;the&nbsp;byte&nbsp;order&nbsp;to&nbsp;be&nbsp;used,&nbsp;this&nbsp;must&nbsp;be&nbsp;one&nbsp;of&nbsp;the&nbsp;class</span></div></li>
<li><div class="src-line"><a name="a49"></a><span class="src-doc">&nbsp;*&nbsp;constants&nbsp;</span><span class="src-doc-inlinetag">{@link&nbsp;LITTLE_ENDIAN}</span><span class="src-doc">&nbsp;or&nbsp;</span><span class="src-doc-inlinetag">{@link&nbsp;BIG_ENDIAN}</span><span class="src-doc">.&nbsp;&nbsp;These</span></div></li>
<li><div class="src-line"><a name="a50"></a><span class="src-doc">&nbsp;*&nbsp;constants&nbsp;will&nbsp;be&nbsp;referred&nbsp;to&nbsp;as&nbsp;the&nbsp;pseudo&nbsp;type&nbsp;PelByteOrder</span></div></li>
<li><div class="src-line"><a name="a51"></a><span class="src-doc">&nbsp;*&nbsp;throughout&nbsp;the&nbsp;documentation.</span></div></li>
<li><div class="src-line"><a name="a52"></a><span class="src-doc">&nbsp;*</span></div></li>
<li><div class="src-line"><a name="a53"></a><span class="src-doc">&nbsp;*&nbsp;</span><span class="src-doc-coretag">@author</span><span class="src-doc">&nbsp;Martin&nbsp;Geisler&nbsp;&lt;hide@address.com&gt;</span></div></li>
<li><div class="src-line"><a name="a54"></a><span class="src-doc">&nbsp;*&nbsp;</span><span class="src-doc-coretag">@package</span><span class="src-doc">&nbsp;PEL</span></div></li>
<li><div class="src-line"><a name="a55"></a><span class="src-doc">&nbsp;*/</span></div></li>
<li><div class="src-line"><a name="a56"></a><span class="src-key">class&nbsp;</span><a href="../PEL/PelConvert.html">PelConvert</a>&nbsp;<span class="src-sym">{</span></div></li>
<li><div class="src-line"><a name="a57"></a>&nbsp;</div></li>
<li><div class="src-line"><a name="a58"></a>&nbsp;&nbsp;<span class="src-doc">/**</span></div></li>
<li><div class="src-line"><a name="a59"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;*&nbsp;Little-endian&nbsp;(Intel)&nbsp;byte&nbsp;order.</span></div></li>
<li><div class="src-line"><a name="a60"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;*</span></div></li>
<li><div class="src-line"><a name="a61"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;*&nbsp;Data&nbsp;stored&nbsp;in&nbsp;little-endian&nbsp;byte&nbsp;order&nbsp;store&nbsp;the&nbsp;least</span></div></li>
<li><div class="src-line"><a name="a62"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;*&nbsp;significant&nbsp;byte&nbsp;first,&nbsp;so&nbsp;the&nbsp;number&nbsp;0x12345678&nbsp;becomes&nbsp;0x78</span></div></li>
<li><div class="src-line"><a name="a63"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;*&nbsp;0x56&nbsp;0x34&nbsp;0x12&nbsp;when&nbsp;stored&nbsp;with&nbsp;little-endian&nbsp;byte&nbsp;order.</span></div></li>
<li><div class="src-line"><a name="a64"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;*/</span></div></li>
<li><div class="src-line"><a name="a65"></a>&nbsp;&nbsp;<span class="src-key">const&nbsp;</span><span class="src-id">LITTLE_ENDIAN&nbsp;</span>=&nbsp;<span class="src-id">true</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a66"></a>&nbsp;</div></li>
<li><div class="src-line"><a name="a67"></a>&nbsp;&nbsp;<span class="src-doc">/**</span></div></li>
<li><div class="src-line"><a name="a68"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;*&nbsp;Big-endian&nbsp;(Motorola)&nbsp;byte&nbsp;order.</span></div></li>
<li><div class="src-line"><a name="a69"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;*</span></div></li>
<li><div class="src-line"><a name="a70"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;*&nbsp;Data&nbsp;stored&nbsp;in&nbsp;big-endian&nbsp;byte&nbsp;order&nbsp;store&nbsp;the&nbsp;most&nbsp;significant</span></div></li>
<li><div class="src-line"><a name="a71"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;*&nbsp;byte&nbsp;first,&nbsp;so&nbsp;the&nbsp;number&nbsp;0x12345678&nbsp;becomes&nbsp;0x12&nbsp;0x34&nbsp;0x56&nbsp;0x78</span></div></li>
<li><div class="src-line"><a name="a72"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;*&nbsp;when&nbsp;stored&nbsp;with&nbsp;big-endian&nbsp;byte&nbsp;order.</span></div></li>
<li><div class="src-line"><a name="a73"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;*/</span></div></li>
<li><div class="src-line"><a name="a74"></a>&nbsp;&nbsp;<span class="src-key">const&nbsp;</span><span class="src-id">BIG_ENDIAN&nbsp;</span>=&nbsp;<span class="src-id">false</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a75"></a>&nbsp;</div></li>
<li><div class="src-line"><a name="a76"></a>&nbsp;</div></li>
<li><div class="src-line"><a name="a77"></a>&nbsp;&nbsp;<span class="src-doc">/**</span></div></li>
<li><div class="src-line"><a name="a78"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;*&nbsp;Convert&nbsp;an&nbsp;unsigned&nbsp;short&nbsp;into&nbsp;two&nbsp;bytes.</span></div></li>
<li><div class="src-line"><a name="a79"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;*</span></div></li>
<li><div class="src-line"><a name="a80"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;*&nbsp;</span><span class="src-doc-coretag">@param&nbsp;</span><span class="src-doc-type">int&nbsp;</span><span class="src-doc">the&nbsp;unsigned&nbsp;short&nbsp;that&nbsp;will&nbsp;be&nbsp;converted.&nbsp;&nbsp;The&nbsp;lower</span></div></li>
<li><div class="src-line"><a name="a81"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;*&nbsp;&nbsp;two&nbsp;bytes&nbsp;will&nbsp;be&nbsp;extracted&nbsp;regardless&nbsp;of&nbsp;the&nbsp;actual&nbsp;size&nbsp;passed.</span></div></li>
<li><div class="src-line"><a name="a82"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;*</span></div></li>
<li><div class="src-line"><a name="a83"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;*&nbsp;</span><span class="src-doc-coretag">@param&nbsp;</span><span class="src-doc-type">PelByteOrder&nbsp;</span><span class="src-doc">one&nbsp;of&nbsp;</span><span class="src-doc-inlinetag">{@link&nbsp;LITTLE_ENDIAN}</span><span class="src-doc">&nbsp;and&nbsp;</span><span class="src-doc-inlinetag">{@link&nbsp;}</span></div></li>
<li><div class="src-line"><a name="a84"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;*&nbsp;&nbsp;BIG_ENDIAN}.</span></div></li>
<li><div class="src-line"><a name="a85"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;*</span></div></li>
<li><div class="src-line"><a name="a86"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;*&nbsp;</span><span class="src-doc-coretag">@return&nbsp;</span><span class="src-doc-type">string&nbsp;</span><span class="src-doc">the&nbsp;bytes&nbsp;representing&nbsp;the&nbsp;unsigned&nbsp;short.</span></div></li>
<li><div class="src-line"><a name="a87"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;*/</span></div></li>
<li><div class="src-line"><a name="a88"></a>&nbsp;&nbsp;<span class="src-key">static&nbsp;</span><span class="src-key">function&nbsp;</span><a href="../PEL/PelConvert.html#methodshortToBytes">shortToBytes</a><span class="src-sym">(</span><span class="src-var">$value</span><span class="src-sym">,&nbsp;</span><span class="src-var">$endian</span><span class="src-sym">)&nbsp;</span><span class="src-sym">{</span></div></li>
<li><div class="src-line"><a name="a89"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">if&nbsp;</span><span class="src-sym">(</span><span class="src-var">$endian&nbsp;</span>==&nbsp;<span class="src-id">self</span><span class="src-sym">::</span><span class="src-id">LITTLE_ENDIAN</span><span class="src-sym">)</span></div></li>
<li><div class="src-line"><a name="a90"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">return&nbsp;</span><a href="http://www.php.net/chr">chr</a><span class="src-sym">(</span><span class="src-var">$value</span><span class="src-sym">)&nbsp;</span>.&nbsp;<a href="http://www.php.net/chr">chr</a><span class="src-sym">(</span><span class="src-var">$value&nbsp;</span>&gt;&gt;&nbsp;<span class="src-num">8</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a91"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">else</span></div></li>
<li><div class="src-line"><a name="a92"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">return&nbsp;</span><a href="http://www.php.net/chr">chr</a><span class="src-sym">(</span><span class="src-var">$value&nbsp;</span>&gt;&gt;&nbsp;<span class="src-num">8</span><span class="src-sym">)&nbsp;</span>.&nbsp;<a href="http://www.php.net/chr">chr</a><span class="src-sym">(</span><span class="src-var">$value</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a93"></a>&nbsp;&nbsp;<span class="src-sym">}</span></div></li>
<li><div class="src-line"><a name="a94"></a>&nbsp;</div></li>
<li><div class="src-line"><a name="a95"></a>&nbsp;</div></li>
<li><div class="src-line"><a name="a96"></a>&nbsp;&nbsp;<span class="src-doc">/**</span></div></li>
<li><div class="src-line"><a name="a97"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;*&nbsp;Convert&nbsp;a&nbsp;signed&nbsp;short&nbsp;into&nbsp;two&nbsp;bytes.</span></div></li>
<li><div class="src-line"><a name="a98"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;*</span></div></li>
<li><div class="src-line"><a name="a99"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;*&nbsp;</span><span class="src-doc-coretag">@param&nbsp;</span><span class="src-doc-type">int&nbsp;</span><span class="src-doc">the&nbsp;signed&nbsp;short&nbsp;that&nbsp;will&nbsp;be&nbsp;converted.&nbsp;&nbsp;The&nbsp;lower</span></div></li>
<li><div class="src-line"><a name="a100"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;*&nbsp;&nbsp;two&nbsp;bytes&nbsp;will&nbsp;be&nbsp;extracted&nbsp;regardless&nbsp;of&nbsp;the&nbsp;actual&nbsp;size&nbsp;passed.</span></div></li>
<li><div class="src-line"><a name="a101"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;*</span></div></li>
<li><div class="src-line"><a name="a102"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;*&nbsp;</span><span class="src-doc-coretag">@param&nbsp;</span><span class="src-doc-type">PelByteOrder&nbsp;</span><span class="src-doc">one&nbsp;of&nbsp;</span><span class="src-doc-inlinetag">{@link&nbsp;LITTLE_ENDIAN}</span><span class="src-doc">&nbsp;and&nbsp;</span><span class="src-doc-inlinetag">{@link&nbsp;}</span></div></li>
<li><div class="src-line"><a name="a103"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;*&nbsp;&nbsp;BIG_ENDIAN}.</span></div></li>
<li><div class="src-line"><a name="a104"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;*</span></div></li>
<li><div class="src-line"><a name="a105"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;*&nbsp;</span><span class="src-doc-coretag">@return&nbsp;</span><span class="src-doc-type">string&nbsp;</span><span class="src-doc">the&nbsp;bytes&nbsp;representing&nbsp;the&nbsp;signed&nbsp;short.</span></div></li>
<li><div class="src-line"><a name="a106"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;*/</span></div></li>
<li><div class="src-line"><a name="a107"></a>&nbsp;&nbsp;<span class="src-key">static&nbsp;</span><span class="src-key">function&nbsp;</span><a href="../PEL/PelConvert.html#methodsShortToBytes">sShortToBytes</a><span class="src-sym">(</span><span class="src-var">$value</span><span class="src-sym">,&nbsp;</span><span class="src-var">$endian</span><span class="src-sym">)&nbsp;</span><span class="src-sym">{</span></div></li>
<li><div class="src-line"><a name="a108"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-comm">/*&nbsp;We&nbsp;can&nbsp;just&nbsp;use&nbsp;shortToBytes,&nbsp;since&nbsp;signed&nbsp;shorts&nbsp;fits&nbsp;well</span></div></li>
<li><div class="src-line"><a name="a109"></a><span class="src-comm">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;within&nbsp;the&nbsp;32&nbsp;bit&nbsp;signed&nbsp;integers&nbsp;used&nbsp;in&nbsp;PHP.&nbsp;*/</span></div></li>
<li><div class="src-line"><a name="a110"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">return&nbsp;</span><span class="src-id">self</span><span class="src-sym">::</span><span class="src-id">shortToBytes</span><span class="src-sym">(</span><span class="src-var">$value</span><span class="src-sym">,&nbsp;</span><span class="src-var">$endian</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a111"></a>&nbsp;&nbsp;<span class="src-sym">}</span></div></li>
<li><div class="src-line"><a name="a112"></a>&nbsp;&nbsp;</div></li>
<li><div class="src-line"><a name="a113"></a>&nbsp;</div></li>
<li><div class="src-line"><a name="a114"></a>&nbsp;&nbsp;<span class="src-doc">/**</span></div></li>
<li><div class="src-line"><a name="a115"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;*&nbsp;Convert&nbsp;an&nbsp;unsigned&nbsp;long&nbsp;into&nbsp;four&nbsp;bytes.</span></div></li>
<li><div class="src-line"><a name="a116"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;*</span></div></li>
<li><div class="src-line"><a name="a117"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;*&nbsp;Because&nbsp;PHP&nbsp;limits&nbsp;the&nbsp;size&nbsp;of&nbsp;integers&nbsp;to&nbsp;32&nbsp;bit&nbsp;signed,&nbsp;one</span></div></li>
<li><div class="src-line"><a name="a118"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;*&nbsp;cannot&nbsp;really&nbsp;have&nbsp;an&nbsp;unsigned&nbsp;integer&nbsp;in&nbsp;PHP.&nbsp;&nbsp;But&nbsp;integers</span></div></li>
<li><div class="src-line"><a name="a119"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;*&nbsp;larger&nbsp;than&nbsp;2^31-1&nbsp;will&nbsp;be&nbsp;promoted&nbsp;to&nbsp;64&nbsp;bit&nbsp;signed&nbsp;floating</span></div></li>
<li><div class="src-line"><a name="a120"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;*&nbsp;point&nbsp;numbers,&nbsp;and&nbsp;so&nbsp;such&nbsp;large&nbsp;numbers&nbsp;can&nbsp;be&nbsp;handled&nbsp;too.</span></div></li>
<li><div class="src-line"><a name="a121"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;*</span></div></li>
<li><div class="src-line"><a name="a122"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;*&nbsp;</span><span class="src-doc-coretag">@param&nbsp;</span><span class="src-doc-type">int&nbsp;</span><span class="src-doc">the&nbsp;unsigned&nbsp;long&nbsp;that&nbsp;will&nbsp;be&nbsp;converted.&nbsp;&nbsp;The</span></div></li>
<li><div class="src-line"><a name="a123"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;*&nbsp;&nbsp;argument&nbsp;will&nbsp;be&nbsp;treated&nbsp;as&nbsp;an&nbsp;unsigned&nbsp;32&nbsp;bit&nbsp;integer&nbsp;and&nbsp;the</span></div></li>
<li><div class="src-line"><a name="a124"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;*&nbsp;&nbsp;lower&nbsp;four&nbsp;bytes&nbsp;will&nbsp;be&nbsp;extracted.&nbsp;&nbsp;Treating&nbsp;the&nbsp;argument&nbsp;as&nbsp;an</span></div></li>
<li><div class="src-line"><a name="a125"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;*&nbsp;&nbsp;unsigned&nbsp;integer&nbsp;means&nbsp;that&nbsp;the&nbsp;absolute&nbsp;value&nbsp;will&nbsp;be&nbsp;used.&nbsp;&nbsp;Use</span></div></li>
<li><div class="src-line"><a name="a126"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;*&nbsp;&nbsp;</span><span class="src-doc-inlinetag">{@link&nbsp;sLongToBytes}</span><span class="src-doc">&nbsp;to&nbsp;convert&nbsp;signed&nbsp;integers.</span></div></li>
<li><div class="src-line"><a name="a127"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;*</span></div></li>
<li><div class="src-line"><a name="a128"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;*&nbsp;</span><span class="src-doc-coretag">@param&nbsp;</span><span class="src-doc-type">PelByteOrder&nbsp;</span><span class="src-doc">one&nbsp;of&nbsp;</span><span class="src-doc-inlinetag">{@link&nbsp;LITTLE_ENDIAN}</span><span class="src-doc">&nbsp;and&nbsp;</span><span class="src-doc-inlinetag">{@link&nbsp;}</span></div></li>
<li><div class="src-line"><a name="a129"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;*&nbsp;&nbsp;BIG_ENDIAN}.</span></div></li>
<li><div class="src-line"><a name="a130"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;*</span></div></li>
<li><div class="src-line"><a name="a131"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;*&nbsp;</span><span class="src-doc-coretag">@return&nbsp;</span><span class="src-doc-type">string&nbsp;</span><span class="src-doc">the&nbsp;bytes&nbsp;representing&nbsp;the&nbsp;unsigned&nbsp;long.</span></div></li>
<li><div class="src-line"><a name="a132"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;*/</span></div></li>
<li><div class="src-line"><a name="a133"></a>&nbsp;&nbsp;<span class="src-key">static&nbsp;</span><span class="src-key">function&nbsp;</span><a href="../PEL/PelConvert.html#methodlongToBytes">longToBytes</a><span class="src-sym">(</span><span class="src-var">$value</span><span class="src-sym">,&nbsp;</span><span class="src-var">$endian</span><span class="src-sym">)&nbsp;</span><span class="src-sym">{</span></div></li>
<li><div class="src-line"><a name="a134"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-comm">/*&nbsp;We&nbsp;cannot&nbsp;convert&nbsp;the&nbsp;number&nbsp;to&nbsp;bytes&nbsp;in&nbsp;the&nbsp;normal&nbsp;way&nbsp;(using</span></div></li>
<li><div class="src-line"><a name="a135"></a><span class="src-comm">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;shifts&nbsp;and&nbsp;modulo&nbsp;calculations)&nbsp;because&nbsp;the&nbsp;PHP&nbsp;operator&nbsp;&gt;&gt;&nbsp;and</span></div></li>
<li><div class="src-line"><a name="a136"></a><span class="src-comm">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;function&nbsp;chr()&nbsp;clip&nbsp;their&nbsp;arguments&nbsp;to&nbsp;2^31-1,&nbsp;which&nbsp;is&nbsp;the</span></div></li>
<li><div class="src-line"><a name="a137"></a><span class="src-comm">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;largest&nbsp;signed&nbsp;integer&nbsp;known&nbsp;to&nbsp;PHP.&nbsp;&nbsp;But&nbsp;luckily&nbsp;base_convert</span></div></li>
<li><div class="src-line"><a name="a138"></a><span class="src-comm">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;handles&nbsp;such&nbsp;big&nbsp;numbers.&nbsp;*/</span></div></li>
<li><div class="src-line"><a name="a139"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$hex&nbsp;</span>=&nbsp;<a href="http://www.php.net/str_pad">str_pad</a><span class="src-sym">(</span><a href="http://www.php.net/base_convert">base_convert</a><span class="src-sym">(</span><span class="src-var">$value</span><span class="src-sym">,&nbsp;</span><span class="src-num">10</span><span class="src-sym">,&nbsp;</span><span class="src-num">16</span><span class="src-sym">)</span><span class="src-sym">,&nbsp;</span><span class="src-num">8</span><span class="src-sym">,&nbsp;</span><span class="src-str">'0'</span><span class="src-sym">,&nbsp;</span><span class="src-id">STR_PAD_LEFT</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a140"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">if&nbsp;</span><span class="src-sym">(</span><span class="src-var">$endian&nbsp;</span>==&nbsp;<span class="src-id">self</span><span class="src-sym">::</span><span class="src-id">LITTLE_ENDIAN</span><span class="src-sym">)</span></div></li>
<li><div class="src-line"><a name="a141"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">return&nbsp;</span><span class="src-sym">(</span><a href="http://www.php.net/chr">chr</a><span class="src-sym">(</span><a href="http://www.php.net/hexdec">hexdec</a><span class="src-sym">(</span><span class="src-var">$hex</span><span class="src-sym">{</span><span class="src-num">6</span><span class="src-sym">}&nbsp;</span>.&nbsp;<span class="src-var">$hex</span><span class="src-sym">{</span><span class="src-num">7</span><span class="src-sym">}</span><span class="src-sym">))&nbsp;</span>.</div></li>
<li><div class="src-line"><a name="a142"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a href="http://www.php.net/chr">chr</a><span class="src-sym">(</span><a href="http://www.php.net/hexdec">hexdec</a><span class="src-sym">(</span><span class="src-var">$hex</span><span class="src-sym">{</span><span class="src-num">4</span><span class="src-sym">}&nbsp;</span>.&nbsp;<span class="src-var">$hex</span><span class="src-sym">{</span><span class="src-num">5</span><span class="src-sym">}</span><span class="src-sym">))&nbsp;</span>.</div></li>
<li><div class="src-line"><a name="a143"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a href="http://www.php.net/chr">chr</a><span class="src-sym">(</span><a href="http://www.php.net/hexdec">hexdec</a><span class="src-sym">(</span><span class="src-var">$hex</span><span class="src-sym">{</span><span class="src-num">2</span><span class="src-sym">}&nbsp;</span>.&nbsp;<span class="src-var">$hex</span><span class="src-sym">{</span><span class="src-num">3</span><span class="src-sym">}</span><span class="src-sym">))&nbsp;</span>.</div></li>
<li><div class="src-line"><a name="a144"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a href="http://www.php.net/chr">chr</a><span class="src-sym">(</span><a href="http://www.php.net/hexdec">hexdec</a><span class="src-sym">(</span><span class="src-var">$hex</span><span class="src-sym">{</span><span class="src-num">0</span><span class="src-sym">}&nbsp;</span>.&nbsp;<span class="src-var">$hex</span><span class="src-sym">{</span><span class="src-num">1</span><span class="src-sym">}</span><span class="src-sym">)))</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a145"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">else</span></div></li>
<li><div class="src-line"><a name="a146"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">return&nbsp;</span><span class="src-sym">(</span><a href="http://www.php.net/chr">chr</a><span class="src-sym">(</span><a href="http://www.php.net/hexdec">hexdec</a><span class="src-sym">(</span><span class="src-var">$hex</span><span class="src-sym">{</span><span class="src-num">0</span><span class="src-sym">}&nbsp;</span>.&nbsp;<span class="src-var">$hex</span><span class="src-sym">{</span><span class="src-num">1</span><span class="src-sym">}</span><span class="src-sym">))&nbsp;</span>.</div></li>
<li><div class="src-line"><a name="a147"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a href="http://www.php.net/chr">chr</a><span class="src-sym">(</span><a href="http://www.php.net/hexdec">hexdec</a><span class="src-sym">(</span><span class="src-var">$hex</span><span class="src-sym">{</span><span class="src-num">2</span><span class="src-sym">}&nbsp;</span>.&nbsp;<span class="src-var">$hex</span><span class="src-sym">{</span><span class="src-num">3</span><span class="src-sym">}</span><span class="src-sym">))&nbsp;</span>.</div></li>
<li><div class="src-line"><a name="a148"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a href="http://www.php.net/chr">chr</a><span class="src-sym">(</span><a href="http://www.php.net/hexdec">hexdec</a><span class="src-sym">(</span><span class="src-var">$hex</span><span class="src-sym">{</span><span class="src-num">4</span><span class="src-sym">}&nbsp;</span>.&nbsp;<span class="src-var">$hex</span><span class="src-sym">{</span><span class="src-num">5</span><span class="src-sym">}</span><span class="src-sym">))&nbsp;</span>.</div></li>
<li><div class="src-line"><a name="a149"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a href="http://www.php.net/chr">chr</a><span class="src-sym">(</span><a href="http://www.php.net/hexdec">hexdec</a><span class="src-sym">(</span><span class="src-var">$hex</span><span class="src-sym">{</span><span class="src-num">6</span><span class="src-sym">}&nbsp;</span>.&nbsp;<span class="src-var">$hex</span><span class="src-sym">{</span><span class="src-num">7</span><span class="src-sym">}</span><span class="src-sym">)))</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a150"></a>&nbsp;&nbsp;<span class="src-sym">}</span></div></li>
<li><div class="src-line"><a name="a151"></a>&nbsp;</div></li>
<li><div class="src-line"><a name="a152"></a>&nbsp;</div></li>
<li><div class="src-line"><a name="a153"></a>&nbsp;&nbsp;<span class="src-doc">/**</span></div></li>
<li><div class="src-line"><a name="a154"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;*&nbsp;Convert&nbsp;a&nbsp;signed&nbsp;long&nbsp;into&nbsp;four&nbsp;bytes.</span></div></li>
<li><div class="src-line"><a name="a155"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;*</span></div></li>
<li><div class="src-line"><a name="a156"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;*&nbsp;</span><span class="src-doc-coretag">@param&nbsp;</span><span class="src-doc-type">int&nbsp;</span><span class="src-doc">the&nbsp;signed&nbsp;long&nbsp;that&nbsp;will&nbsp;be&nbsp;converted.&nbsp;&nbsp;The&nbsp;argument</span></div></li>
<li><div class="src-line"><a name="a157"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;*&nbsp;&nbsp;will&nbsp;be&nbsp;treated&nbsp;as&nbsp;a&nbsp;signed&nbsp;32&nbsp;bit&nbsp;integer,&nbsp;from&nbsp;which&nbsp;the&nbsp;lower</span></div></li>
<li><div class="src-line"><a name="a158"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;*&nbsp;&nbsp;four&nbsp;bytes&nbsp;will&nbsp;be&nbsp;extracted.</span></div></li>
<li><div class="src-line"><a name="a159"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;*</span></div></li>
<li><div class="src-line"><a name="a160"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;*&nbsp;</span><span class="src-doc-coretag">@param&nbsp;</span><span class="src-doc-type">PelByteOrder&nbsp;</span><span class="src-doc">one&nbsp;of&nbsp;</span><span class="src-doc-inlinetag">{@link&nbsp;LITTLE_ENDIAN}</span><span class="src-doc">&nbsp;and&nbsp;</span><span class="src-doc-inlinetag">{@link&nbsp;}</span></div></li>
<li><div class="src-line"><a name="a161"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;*&nbsp;&nbsp;BIG_ENDIAN}.</span></div></li>
<li><div class="src-line"><a name="a162"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;*</span></div></li>
<li><div class="src-line"><a name="a163"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;*&nbsp;</span><span class="src-doc-coretag">@return&nbsp;</span><span class="src-doc-type">string&nbsp;</span><span class="src-doc">the&nbsp;bytes&nbsp;representing&nbsp;the&nbsp;signed&nbsp;long.</span></div></li>
<li><div class="src-line"><a name="a164"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;*/</span></div></li>
<li><div class="src-line"><a name="a165"></a>&nbsp;&nbsp;<span class="src-key">static&nbsp;</span><span class="src-key">function&nbsp;</span><a href="../PEL/PelConvert.html#methodsLongToBytes">sLongToBytes</a><span class="src-sym">(</span><span class="src-var">$value</span><span class="src-sym">,&nbsp;</span><span class="src-var">$endian</span><span class="src-sym">)&nbsp;</span><span class="src-sym">{</span></div></li>
<li><div class="src-line"><a name="a166"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-comm">/*&nbsp;We&nbsp;can&nbsp;convert&nbsp;the&nbsp;number&nbsp;into&nbsp;bytes&nbsp;in&nbsp;the&nbsp;normal&nbsp;way&nbsp;using</span></div></li>
<li><div class="src-line"><a name="a167"></a><span class="src-comm">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;shifts&nbsp;and&nbsp;modulo&nbsp;calculations&nbsp;here&nbsp;(in&nbsp;contrast&nbsp;with</span></div></li>
<li><div class="src-line"><a name="a168"></a><span class="src-comm">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;longToBytes)&nbsp;because&nbsp;PHP&nbsp;automatically&nbsp;handles&nbsp;32&nbsp;bit&nbsp;signed</span></div></li>
<li><div class="src-line"><a name="a169"></a><span class="src-comm">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;integers&nbsp;for&nbsp;us.&nbsp;*/</span></div></li>
<li><div class="src-line"><a name="a170"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">if&nbsp;</span><span class="src-sym">(</span><span class="src-var">$endian&nbsp;</span>==&nbsp;<span class="src-id">self</span><span class="src-sym">::</span><span class="src-id">LITTLE_ENDIAN</span><span class="src-sym">)</span></div></li>
<li><div class="src-line"><a name="a171"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">return&nbsp;</span><span class="src-sym">(</span><a href="http://www.php.net/chr">chr</a><span class="src-sym">(</span><span class="src-var">$value</span><span class="src-sym">)&nbsp;</span>.</div></li>
<li><div class="src-line"><a name="a172"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a href="http://www.php.net/chr">chr</a><span class="src-sym">(</span><span class="src-var">$value&nbsp;</span>&gt;&gt;&nbsp;&nbsp;<span class="src-num">8</span><span class="src-sym">)&nbsp;</span>.</div></li>
<li><div class="src-line"><a name="a173"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a href="http://www.php.net/chr">chr</a><span class="src-sym">(</span><span class="src-var">$value&nbsp;</span>&gt;&gt;&nbsp;<span class="src-num">16</span><span class="src-sym">)&nbsp;</span>.</div></li>
<li><div class="src-line"><a name="a174"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a href="http://www.php.net/chr">chr</a><span class="src-sym">(</span><span class="src-var">$value&nbsp;</span>&gt;&gt;&nbsp;<span class="src-num">24</span><span class="src-sym">))</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a175"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">else</span></div></li>
<li><div class="src-line"><a name="a176"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">return&nbsp;</span><span class="src-sym">(</span><a href="http://www.php.net/chr">chr</a><span class="src-sym">(</span><span class="src-var">$value&nbsp;</span>&gt;&gt;&nbsp;<span class="src-num">24</span><span class="src-sym">)&nbsp;</span>.</div></li>
<li><div class="src-line"><a name="a177"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a href="http://www.php.net/chr">chr</a><span class="src-sym">(</span><span class="src-var">$value&nbsp;</span>&gt;&gt;&nbsp;<span class="src-num">16</span><span class="src-sym">)&nbsp;</span>.</div></li>
<li><div class="src-line"><a name="a178"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a href="http://www.php.net/chr">chr</a><span class="src-sym">(</span><span class="src-var">$value&nbsp;</span>&gt;&gt;&nbsp;&nbsp;<span class="src-num">8</span><span class="src-sym">)&nbsp;</span>.</div></li>
<li><div class="src-line"><a name="a179"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a href="http://www.php.net/chr">chr</a><span class="src-sym">(</span><span class="src-var">$value</span><span class="src-sym">))</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a180"></a>&nbsp;&nbsp;<span class="src-sym">}</span></div></li>
<li><div class="src-line"><a name="a181"></a>&nbsp;</div></li>
<li><div class="src-line"><a name="a182"></a>&nbsp;</div></li>
<li><div class="src-line"><a name="a183"></a>&nbsp;&nbsp;<span class="src-doc">/**</span></div></li>
<li><div class="src-line"><a name="a184"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;*&nbsp;Extract&nbsp;an&nbsp;unsigned&nbsp;byte&nbsp;from&nbsp;a&nbsp;string&nbsp;of&nbsp;bytes.</span></div></li>
<li><div class="src-line"><a name="a185"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;*</span></div></li>
<li><div class="src-line"><a name="a186"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;*&nbsp;</span><span class="src-doc-coretag">@param&nbsp;</span><span class="src-doc-type">string&nbsp;</span><span class="src-doc">the&nbsp;bytes.</span></div></li>
<li><div class="src-line"><a name="a187"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;*</span></div></li>
<li><div class="src-line"><a name="a188"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;*&nbsp;</span><span class="src-doc-coretag">@param&nbsp;</span><span class="src-doc-type">int&nbsp;</span><span class="src-doc">the&nbsp;offset.&nbsp;&nbsp;The&nbsp;byte&nbsp;found&nbsp;at&nbsp;the&nbsp;offset&nbsp;will&nbsp;be</span></div></li>
<li><div class="src-line"><a name="a189"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;*&nbsp;&nbsp;returned&nbsp;as&nbsp;an&nbsp;integer.&nbsp;&nbsp;The&nbsp;must&nbsp;be&nbsp;at&nbsp;least&nbsp;one&nbsp;byte&nbsp;available</span></div></li>
<li><div class="src-line"><a name="a190"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;*&nbsp;&nbsp;at&nbsp;offset.</span></div></li>
<li><div class="src-line"><a name="a191"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;*</span></div></li>
<li><div class="src-line"><a name="a192"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;*&nbsp;</span><span class="src-doc-coretag">@return&nbsp;</span><span class="src-doc-type">int&nbsp;</span><span class="src-doc">the&nbsp;unsigned&nbsp;byte&nbsp;found&nbsp;at&nbsp;offset,&nbsp;e.g.,&nbsp;an&nbsp;integer</span></div></li>
<li><div class="src-line"><a name="a193"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;*&nbsp;&nbsp;in&nbsp;the&nbsp;range&nbsp;0&nbsp;to&nbsp;255.</span></div></li>
<li><div class="src-line"><a name="a194"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;*/</span></div></li>
<li><div class="src-line"><a name="a195"></a>&nbsp;&nbsp;<span class="src-key">static&nbsp;</span><span class="src-key">function&nbsp;</span><a href="../PEL/PelConvert.html#methodbytesToByte">bytesToByte</a><span class="src-sym">(</span><span class="src-var">$bytes</span><span class="src-sym">,&nbsp;</span><span class="src-var">$offset</span><span class="src-sym">)&nbsp;</span><span class="src-sym">{</span></div></li>
<li><div class="src-line"><a name="a196"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">return&nbsp;</span><a href="http://www.php.net/ord">ord</a><span class="src-sym">(</span><span class="src-var">$bytes</span><span class="src-sym">{</span><span class="src-var">$offset</span><span class="src-sym">}</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a197"></a>&nbsp;&nbsp;<span class="src-sym">}</span></div></li>
<li><div class="src-line"><a name="a198"></a>&nbsp;</div></li>
<li><div class="src-line"><a name="a199"></a>&nbsp;</div></li>
<li><div class="src-line"><a name="a200"></a>&nbsp;&nbsp;<span class="src-doc">/**</span></div></li>
<li><div class="src-line"><a name="a201"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;*&nbsp;Extract&nbsp;a&nbsp;signed&nbsp;byte&nbsp;from&nbsp;bytes.</span></div></li>
<li><div class="src-line"><a name="a202"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;*</span></div></li>
<li><div class="src-line"><a name="a203"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;*&nbsp;</span><span class="src-doc-coretag">@param&nbsp;</span><span class="src-doc-type">string&nbsp;</span><span class="src-doc">the&nbsp;bytes.</span></div></li>
<li><div class="src-line"><a name="a204"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;*</span></div></li>
<li><div class="src-line"><a name="a205"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;*&nbsp;</span><span class="src-doc-coretag">@param&nbsp;</span><span class="src-doc-type">int&nbsp;</span><span class="src-doc">the&nbsp;offset.&nbsp;&nbsp;The&nbsp;byte&nbsp;found&nbsp;at&nbsp;the&nbsp;offset&nbsp;will&nbsp;be</span></div></li>
<li><div class="src-line"><a name="a206"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;*&nbsp;&nbsp;returned&nbsp;as&nbsp;an&nbsp;integer.&nbsp;&nbsp;The&nbsp;must&nbsp;be&nbsp;at&nbsp;least&nbsp;one&nbsp;byte&nbsp;available</span></div></li>
<li><div class="src-line"><a name="a207"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;*&nbsp;&nbsp;at&nbsp;offset.</span></div></li>
<li><div class="src-line"><a name="a208"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;*</span></div></li>
<li><div class="src-line"><a name="a209"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;*&nbsp;</span><span class="src-doc-coretag">@return&nbsp;</span><span class="src-doc-type">int&nbsp;</span><span class="src-doc">the&nbsp;signed&nbsp;byte&nbsp;found&nbsp;at&nbsp;offset,&nbsp;e.g.,&nbsp;an&nbsp;integer&nbsp;in</span></div></li>
<li><div class="src-line"><a name="a210"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;*&nbsp;&nbsp;the&nbsp;range&nbsp;-128&nbsp;to&nbsp;127.</span></div></li>
<li><div class="src-line"><a name="a211"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;*/</span></div></li>
<li><div class="src-line"><a name="a212"></a>&nbsp;&nbsp;<span class="src-key">static&nbsp;</span><span class="src-key">function&nbsp;</span><a href="../PEL/PelConvert.html#methodbytesToSByte">bytesToSByte</a><span class="src-sym">(</span><span class="src-var">$bytes</span><span class="src-sym">,&nbsp;</span><span class="src-var">$offset</span><span class="src-sym">)&nbsp;</span><span class="src-sym">{</span></div></li>
<li><div class="src-line"><a name="a213"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$n&nbsp;</span>=&nbsp;<span class="src-id">self</span><span class="src-sym">::</span><span class="src-id">bytesToByte</span><span class="src-sym">(</span><span class="src-var">$bytes</span><span class="src-sym">,&nbsp;</span><span class="src-var">$offset</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a214"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">if&nbsp;</span><span class="src-sym">(</span><span class="src-var">$n&nbsp;</span>&gt;&nbsp;<span class="src-num">127</span><span class="src-sym">)</span></div></li>
<li><div class="src-line"><a name="a215"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">return&nbsp;</span><span class="src-var">$n&nbsp;</span>-&nbsp;<span class="src-num">256</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a216"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">else</span></div></li>
<li><div class="src-line"><a name="a217"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">return&nbsp;</span><span class="src-var">$n</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a218"></a>&nbsp;&nbsp;<span class="src-sym">}</span></div></li>
<li><div class="src-line"><a name="a219"></a>&nbsp;</div></li>
<li><div class="src-line"><a name="a220"></a>&nbsp;</div></li>
<li><div class="src-line"><a name="a221"></a>&nbsp;&nbsp;<span class="src-doc">/**</span></div></li>
<li><div class="src-line"><a name="a222"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;*&nbsp;Extract&nbsp;an&nbsp;unsigned&nbsp;short&nbsp;from&nbsp;bytes.</span></div></li>
<li><div class="src-line"><a name="a223"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;*</span></div></li>
<li><div class="src-line"><a name="a224"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;*&nbsp;</span><span class="src-doc-coretag">@param&nbsp;</span><span class="src-doc-type">string&nbsp;</span><span class="src-doc">the&nbsp;bytes.</span></div></li>
<li><div class="src-line"><a name="a225"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;*</span></div></li>
<li><div class="src-line"><a name="a226"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;*&nbsp;</span><span class="src-doc-coretag">@param&nbsp;</span><span class="src-doc-type">int&nbsp;</span><span class="src-doc">the&nbsp;offset.&nbsp;&nbsp;The&nbsp;short&nbsp;found&nbsp;at&nbsp;the&nbsp;offset&nbsp;will&nbsp;be</span></div></li>
<li><div class="src-line"><a name="a227"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;*&nbsp;&nbsp;returned&nbsp;as&nbsp;an&nbsp;integer.&nbsp;&nbsp;There&nbsp;must&nbsp;be&nbsp;at&nbsp;least&nbsp;two&nbsp;bytes</span></div></li>
<li><div class="src-line"><a name="a228"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;*&nbsp;&nbsp;available&nbsp;beginning&nbsp;at&nbsp;the&nbsp;offset&nbsp;given.</span></div></li>
<li><div class="src-line"><a name="a229"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;*</span></div></li>
<li><div class="src-line"><a name="a230"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;*&nbsp;</span><span class="src-doc-coretag">@return&nbsp;</span><span class="src-doc-type">int&nbsp;</span><span class="src-doc">the&nbsp;unsigned&nbsp;short&nbsp;found&nbsp;at&nbsp;offset,&nbsp;e.g.,&nbsp;an&nbsp;integer</span></div></li>
<li><div class="src-line"><a name="a231"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;*&nbsp;&nbsp;in&nbsp;the&nbsp;range&nbsp;0&nbsp;to&nbsp;65535.</span></div></li>
<li><div class="src-line"><a name="a232"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;*</span></div></li>
<li><div class="src-line"><a name="a233"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;*&nbsp;</span><span class="src-doc-coretag">@param&nbsp;</span><span class="src-doc-type">PelByteOrder&nbsp;</span><span class="src-doc">one&nbsp;of&nbsp;</span><span class="src-doc-inlinetag">{@link&nbsp;LITTLE_ENDIAN}</span><span class="src-doc">&nbsp;and&nbsp;</span><span class="src-doc-inlinetag">{@link&nbsp;}</span></div></li>
<li><div class="src-line"><a name="a234"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;*&nbsp;&nbsp;BIG_ENDIAN}.</span></div></li>
<li><div class="src-line"><a name="a235"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;*/</span></div></li>
<li><div class="src-line"><a name="a236"></a>&nbsp;&nbsp;<span class="src-key">static&nbsp;</span><span class="src-key">function&nbsp;</span><a href="../PEL/PelConvert.html#methodbytesToShort">bytesToShort</a><span class="src-sym">(</span><span class="src-var">$bytes</span><span class="src-sym">,&nbsp;</span><span class="src-var">$offset</span><span class="src-sym">,&nbsp;</span><span class="src-var">$endian</span><span class="src-sym">)&nbsp;</span><span class="src-sym">{</span></div></li>
<li><div class="src-line"><a name="a237"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">if&nbsp;</span><span class="src-sym">(</span><span class="src-var">$endian&nbsp;</span>==&nbsp;<span class="src-id">self</span><span class="src-sym">::</span><span class="src-id">LITTLE_ENDIAN</span><span class="src-sym">)</span></div></li>
<li><div class="src-line"><a name="a238"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">return&nbsp;</span><span class="src-sym">(</span><a href="http://www.php.net/ord">ord</a><span class="src-sym">(</span><span class="src-var">$bytes</span><span class="src-sym">{</span><span class="src-var">$offset</span>+<span class="src-num">1</span><span class="src-sym">}</span><span class="src-sym">)&nbsp;</span>*&nbsp;<span class="src-num">256&nbsp;</span>+</div></li>
<li><div class="src-line"><a name="a239"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a href="http://www.php.net/ord">ord</a><span class="src-sym">(</span><span class="src-var">$bytes</span><span class="src-sym">{</span><span class="src-var">$offset</span><span class="src-sym">}</span><span class="src-sym">))</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a240"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">else</span></div></li>
<li><div class="src-line"><a name="a241"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">return&nbsp;</span><span class="src-sym">(</span><a href="http://www.php.net/ord">ord</a><span class="src-sym">(</span><span class="src-var">$bytes</span><span class="src-sym">{</span><span class="src-var">$offset</span><span class="src-sym">}</span><span class="src-sym">)&nbsp;&nbsp;&nbsp;</span>*&nbsp;<span class="src-num">256&nbsp;</span>+</div></li>
<li><div class="src-line"><a name="a242"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a href="http://www.php.net/ord">ord</a><span class="src-sym">(</span><span class="src-var">$bytes</span><span class="src-sym">{</span><span class="src-var">$offset</span>+<span class="src-num">1</span><span class="src-sym">}</span><span class="src-sym">))</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a243"></a>&nbsp;&nbsp;<span class="src-sym">}</span></div></li>
<li><div class="src-line"><a name="a244"></a>&nbsp;</div></li>
<li><div class="src-line"><a name="a245"></a>&nbsp;</div></li>
<li><div class="src-line"><a name="a246"></a>&nbsp;&nbsp;<span class="src-doc">/**</span></div></li>
<li><div class="src-line"><a name="a247"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;*&nbsp;Extract&nbsp;a&nbsp;signed&nbsp;short&nbsp;from&nbsp;bytes.</span></div></li>
<li><div class="src-line"><a name="a248"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;*</span></div></li>
<li><div class="src-line"><a name="a249"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;*&nbsp;</span><span class="src-doc-coretag">@param&nbsp;</span><span class="src-doc-type">string&nbsp;</span><span class="src-doc">the&nbsp;bytes.</span></div></li>
<li><div class="src-line"><a name="a250"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;*</span></div></li>
<li><div class="src-line"><a name="a251"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;*&nbsp;</span><span class="src-doc-coretag">@param&nbsp;</span><span class="src-doc-type">int&nbsp;</span><span class="src-doc">the&nbsp;offset.&nbsp;&nbsp;The&nbsp;short&nbsp;found&nbsp;at&nbsp;offset&nbsp;will&nbsp;be&nbsp;returned</span></div></li>
<li><div class="src-line"><a name="a252"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;*&nbsp;&nbsp;as&nbsp;an&nbsp;integer.&nbsp;&nbsp;There&nbsp;must&nbsp;be&nbsp;at&nbsp;least&nbsp;two&nbsp;bytes&nbsp;available</span></div></li>
<li><div class="src-line"><a name="a253"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;*&nbsp;&nbsp;beginning&nbsp;at&nbsp;the&nbsp;offset&nbsp;given.</span></div></li>
<li><div class="src-line"><a name="a254"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;*</span></div></li>
<li><div class="src-line"><a name="a255"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;*&nbsp;</span><span class="src-doc-coretag">@return&nbsp;</span><span class="src-doc-type">int&nbsp;</span><span class="src-doc">the&nbsp;signed&nbsp;byte&nbsp;found&nbsp;at&nbsp;offset,&nbsp;e.g.,&nbsp;an&nbsp;integer&nbsp;in</span></div></li>
<li><div class="src-line"><a name="a256"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;*&nbsp;&nbsp;the&nbsp;range&nbsp;-32768&nbsp;to&nbsp;32767.</span></div></li>
<li><div class="src-line"><a name="a257"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;*</span></div></li>
<li><div class="src-line"><a name="a258"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;*&nbsp;</span><span class="src-doc-coretag">@param&nbsp;</span><span class="src-doc-type">PelByteOrder&nbsp;</span><span class="src-doc">one&nbsp;of&nbsp;</span><span class="src-doc-inlinetag">{@link&nbsp;LITTLE_ENDIAN}</span><span class="src-doc">&nbsp;and&nbsp;</span><span class="src-doc-inlinetag">{@link&nbsp;}</span></div></li>
<li><div class="src-line"><a name="a259"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;*&nbsp;&nbsp;BIG_ENDIAN}.</span></div></li>
<li><div class="src-line"><a name="a260"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;*/</span></div></li>
<li><div class="src-line"><a name="a261"></a>&nbsp;&nbsp;<span class="src-key">static&nbsp;</span><span class="src-key">function&nbsp;</span><a href="../PEL/PelConvert.html#methodbytesToSShort">bytesToSShort</a><span class="src-sym">(</span><span class="src-var">$bytes</span><span class="src-sym">,&nbsp;</span><span class="src-var">$offset</span><span class="src-sym">,&nbsp;</span><span class="src-var">$endian</span><span class="src-sym">)&nbsp;</span><span class="src-sym">{</span></div></li>
<li><div class="src-line"><a name="a262"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$n&nbsp;</span>=&nbsp;<span class="src-id">self</span><span class="src-sym">::</span><span class="src-id">bytesToShort</span><span class="src-sym">(</span><span class="src-var">$bytes</span><span class="src-sym">,&nbsp;</span><span class="src-var">$offset</span><span class="src-sym">,&nbsp;</span><span class="src-var">$endian</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a263"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">if&nbsp;</span><span class="src-sym">(</span><span class="src-var">$n&nbsp;</span>&gt;&nbsp;<span class="src-num">32767</span><span class="src-sym">)</span></div></li>
<li><div class="src-line"><a name="a264"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">return&nbsp;</span><span class="src-var">$n&nbsp;</span>-&nbsp;<span class="src-num">65536</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a265"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">else</span></div></li>
<li><div class="src-line"><a name="a266"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">return&nbsp;</span><span class="src-var">$n</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a267"></a>&nbsp;&nbsp;<span class="src-sym">}</span></div></li>
<li><div class="src-line"><a name="a268"></a>&nbsp;</div></li>
<li><div class="src-line"><a name="a269"></a>&nbsp;</div></li>
<li><div class="src-line"><a name="a270"></a>&nbsp;&nbsp;<span class="src-doc">/**</span></div></li>
<li><div class="src-line"><a name="a271"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;*&nbsp;Extract&nbsp;an&nbsp;unsigned&nbsp;long&nbsp;from&nbsp;bytes.</span></div></li>
<li><div class="src-line"><a name="a272"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;*</span></div></li>
<li><div class="src-line"><a name="a273"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;*&nbsp;</span><span class="src-doc-coretag">@param&nbsp;</span><span class="src-doc-type">string&nbsp;</span><span class="src-doc">the&nbsp;bytes.</span></div></li>
<li><div class="src-line"><a name="a274"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;*</span></div></li>
<li><div class="src-line"><a name="a275"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;*&nbsp;</span><span class="src-doc-coretag">@param&nbsp;</span><span class="src-doc-type">int&nbsp;</span><span class="src-doc">the&nbsp;offset.&nbsp;&nbsp;The&nbsp;long&nbsp;found&nbsp;at&nbsp;offset&nbsp;will&nbsp;be&nbsp;returned</span></div></li>
<li><div class="src-line"><a name="a276"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;*&nbsp;&nbsp;as&nbsp;an&nbsp;integer.&nbsp;&nbsp;There&nbsp;must&nbsp;be&nbsp;at&nbsp;least&nbsp;four&nbsp;bytes&nbsp;available</span></div></li>
<li><div class="src-line"><a name="a277"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;*&nbsp;&nbsp;beginning&nbsp;at&nbsp;the&nbsp;offset&nbsp;given.</span></div></li>
<li><div class="src-line"><a name="a278"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;*</span></div></li>
<li><div class="src-line"><a name="a279"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;*&nbsp;</span><span class="src-doc-coretag">@return&nbsp;</span><span class="src-doc-type">int&nbsp;</span><span class="src-doc">the&nbsp;unsigned&nbsp;long&nbsp;found&nbsp;at&nbsp;offset,&nbsp;e.g.,&nbsp;an&nbsp;integer</span></div></li>
<li><div class="src-line"><a name="a280"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;*&nbsp;&nbsp;in&nbsp;the&nbsp;range&nbsp;0&nbsp;to&nbsp;4294967295.</span></div></li>
<li><div class="src-line"><a name="a281"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;*</span></div></li>
<li><div class="src-line"><a name="a282"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;*&nbsp;</span><span class="src-doc-coretag">@param&nbsp;</span><span class="src-doc-type">PelByteOrder&nbsp;</span><span class="src-doc">one&nbsp;of&nbsp;</span><span class="src-doc-inlinetag">{@link&nbsp;LITTLE_ENDIAN}</span><span class="src-doc">&nbsp;and&nbsp;</span><span class="src-doc-inlinetag">{@link&nbsp;}</span></div></li>
<li><div class="src-line"><a name="a283"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;*&nbsp;&nbsp;BIG_ENDIAN}.</span></div></li>
<li><div class="src-line"><a name="a284"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;*/</span></div></li>
<li><div class="src-line"><a name="a285"></a>&nbsp;&nbsp;<span class="src-key">static&nbsp;</span><span class="src-key">function&nbsp;</span><a href="../PEL/PelConvert.html#methodbytesToLong">bytesToLong</a><span class="src-sym">(</span><span class="src-var">$bytes</span><span class="src-sym">,&nbsp;</span><span class="src-var">$offset</span><span class="src-sym">,&nbsp;</span><span class="src-var">$endian</span><span class="src-sym">)&nbsp;</span><span class="src-sym">{</span></div></li>
<li><div class="src-line"><a name="a286"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">if&nbsp;</span><span class="src-sym">(</span><span class="src-var">$endian&nbsp;</span>==&nbsp;<span class="src-id">self</span><span class="src-sym">::</span><span class="src-id">LITTLE_ENDIAN</span><span class="src-sym">)</span></div></li>
<li><div class="src-line"><a name="a287"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">return&nbsp;</span><span class="src-sym">(</span><a href="http://www.php.net/ord">ord</a><span class="src-sym">(</span><span class="src-var">$bytes</span><span class="src-sym">{</span><span class="src-var">$offset</span>+<span class="src-num">3</span><span class="src-sym">}</span><span class="src-sym">)&nbsp;</span>*&nbsp;<span class="src-num">16777216&nbsp;</span>+</div></li>
<li><div class="src-line"><a name="a288"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a href="http://www.php.net/ord">ord</a><span class="src-sym">(</span><span class="src-var">$bytes</span><span class="src-sym">{</span><span class="src-var">$offset</span>+<span class="src-num">2</span><span class="src-sym">}</span><span class="src-sym">)&nbsp;</span>*&nbsp;<span class="src-num">65536&nbsp;&nbsp;&nbsp;&nbsp;</span>+</div></li>
<li><div class="src-line"><a name="a289"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a href="http://www.php.net/ord">ord</a><span class="src-sym">(</span><span class="src-var">$bytes</span><span class="src-sym">{</span><span class="src-var">$offset</span>+<span class="src-num">1</span><span class="src-sym">}</span><span class="src-sym">)&nbsp;</span>*&nbsp;<span class="src-num">256&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span>+</div></li>
<li><div class="src-line"><a name="a290"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a href="http://www.php.net/ord">ord</a><span class="src-sym">(</span><span class="src-var">$bytes</span><span class="src-sym">{</span><span class="src-var">$offset</span><span class="src-sym">}</span><span class="src-sym">))</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a291"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">else</span></div></li>
<li><div class="src-line"><a name="a292"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">return&nbsp;</span><span class="src-sym">(</span><a href="http://www.php.net/ord">ord</a><span class="src-sym">(</span><span class="src-var">$bytes</span><span class="src-sym">{</span><span class="src-var">$offset</span><span class="src-sym">}</span><span class="src-sym">)&nbsp;&nbsp;&nbsp;</span>*&nbsp;<span class="src-num">16777216&nbsp;</span>+</div></li>
<li><div class="src-line"><a name="a293"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a href="http://www.php.net/ord">ord</a><span class="src-sym">(</span><span class="src-var">$bytes</span><span class="src-sym">{</span><span class="src-var">$offset</span>+<span class="src-num">1</span><span class="src-sym">}</span><span class="src-sym">)&nbsp;</span>*&nbsp;<span class="src-num">65536&nbsp;&nbsp;&nbsp;&nbsp;</span>+</div></li>
<li><div class="src-line"><a name="a294"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a href="http://www.php.net/ord">ord</a><span class="src-sym">(</span><span class="src-var">$bytes</span><span class="src-sym">{</span><span class="src-var">$offset</span>+<span class="src-num">2</span><span class="src-sym">}</span><span class="src-sym">)&nbsp;</span>*&nbsp;<span class="src-num">256&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span>+</div></li>
<li><div class="src-line"><a name="a295"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a href="http://www.php.net/ord">ord</a><span class="src-sym">(</span><span class="src-var">$bytes</span><span class="src-sym">{</span><span class="src-var">$offset</span>+<span class="src-num">3</span><span class="src-sym">}</span><span class="src-sym">))</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a296"></a>&nbsp;&nbsp;<span class="src-sym">}</span></div></li>
<li><div class="src-line"><a name="a297"></a>&nbsp;</div></li>
<li><div class="src-line"><a name="a298"></a>&nbsp;</div></li>
<li><div class="src-line"><a name="a299"></a>&nbsp;&nbsp;<span class="src-doc">/**</span></div></li>
<li><div class="src-line"><a name="a300"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;*&nbsp;Extract&nbsp;a&nbsp;signed&nbsp;long&nbsp;from&nbsp;bytes.</span></div></li>
<li><div class="src-line"><a name="a301"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;*</span></div></li>
<li><div class="src-line"><a name="a302"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;*&nbsp;</span><span class="src-doc-coretag">@param&nbsp;</span><span class="src-doc-type">string&nbsp;</span><span class="src-doc">the&nbsp;bytes.</span></div></li>
<li><div class="src-line"><a name="a303"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;*</span></div></li>
<li><div class="src-line"><a name="a304"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;*&nbsp;</span><span class="src-doc-coretag">@param&nbsp;</span><span class="src-doc-type">int&nbsp;</span><span class="src-doc">the&nbsp;offset.&nbsp;&nbsp;The&nbsp;long&nbsp;found&nbsp;at&nbsp;offset&nbsp;will&nbsp;be&nbsp;returned</span></div></li>
<li><div class="src-line"><a name="a305"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;*&nbsp;&nbsp;as&nbsp;an&nbsp;integer.&nbsp;&nbsp;There&nbsp;must&nbsp;be&nbsp;at&nbsp;least&nbsp;four&nbsp;bytes&nbsp;available</span></div></li>
<li><div class="src-line"><a name="a306"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;*&nbsp;&nbsp;beginning&nbsp;at&nbsp;the&nbsp;offset&nbsp;given.</span></div></li>
<li><div class="src-line"><a name="a307"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;*</span></div></li>
<li><div class="src-line"><a name="a308"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;*&nbsp;</span><span class="src-doc-coretag">@return&nbsp;</span><span class="src-doc-type">int&nbsp;</span><span class="src-doc">the&nbsp;signed&nbsp;long&nbsp;found&nbsp;at&nbsp;offset,&nbsp;e.g.,&nbsp;an&nbsp;integer&nbsp;in</span></div></li>
<li><div class="src-line"><a name="a309"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;*&nbsp;&nbsp;the&nbsp;range&nbsp;-2147483648&nbsp;to&nbsp;2147483647.</span></div></li>
<li><div class="src-line"><a name="a310"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;*</span></div></li>
<li><div class="src-line"><a name="a311"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;*&nbsp;</span><span class="src-doc-coretag">@param&nbsp;</span><span class="src-doc-type">PelByteOrder&nbsp;</span><span class="src-doc">one&nbsp;of&nbsp;</span><span class="src-doc-inlinetag">{@link&nbsp;LITTLE_ENDIAN}</span><span class="src-doc">&nbsp;and&nbsp;</span><span class="src-doc-inlinetag">{@link&nbsp;}</span></div></li>
<li><div class="src-line"><a name="a312"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;*&nbsp;&nbsp;BIG_ENDIAN}.</span></div></li>
<li><div class="src-line"><a name="a313"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;*/</span></div></li>
<li><div class="src-line"><a name="a314"></a>&nbsp;&nbsp;<span class="src-key">static&nbsp;</span><span class="src-key">function&nbsp;</span><a href="../PEL/PelConvert.html#methodbytesToSLong">bytesToSLong</a><span class="src-sym">(</span><span class="src-var">$bytes</span><span class="src-sym">,&nbsp;</span><span class="src-var">$offset</span><span class="src-sym">,&nbsp;</span><span class="src-var">$endian</span><span class="src-sym">)&nbsp;</span><span class="src-sym">{</span></div></li>
<li><div class="src-line"><a name="a315"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$n&nbsp;</span>=&nbsp;<span class="src-id">self</span><span class="src-sym">::</span><span class="src-id">bytesToLong</span><span class="src-sym">(</span><span class="src-var">$bytes</span><span class="src-sym">,&nbsp;</span><span class="src-var">$offset</span><span class="src-sym">,&nbsp;</span><span class="src-var">$endian</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a316"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">if&nbsp;</span><span class="src-sym">(</span><span class="src-var">$n&nbsp;</span>&gt;&nbsp;<span class="src-num">2147483647</span><span class="src-sym">)</span></div></li>
<li><div class="src-line"><a name="a317"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">return&nbsp;</span><span class="src-var">$n&nbsp;</span>-&nbsp;<span class="src-num">4294967296</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a318"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">else</span></div></li>
<li><div class="src-line"><a name="a319"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">return&nbsp;</span><span class="src-var">$n</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a320"></a>&nbsp;&nbsp;<span class="src-sym">}</span></div></li>
<li><div class="src-line"><a name="a321"></a>&nbsp;</div></li>
<li><div class="src-line"><a name="a322"></a>&nbsp;</div></li>
<li><div class="src-line"><a name="a323"></a>&nbsp;&nbsp;<span class="src-doc">/**</span></div></li>
<li><div class="src-line"><a name="a324"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;*&nbsp;Extract&nbsp;an&nbsp;unsigned&nbsp;rational&nbsp;from&nbsp;bytes.</span></div></li>
<li><div class="src-line"><a name="a325"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;*</span></div></li>
<li><div class="src-line"><a name="a326"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;*&nbsp;</span><span class="src-doc-coretag">@param&nbsp;</span><span class="src-doc-type">string&nbsp;</span><span class="src-doc">the&nbsp;bytes.</span></div></li>
<li><div class="src-line"><a name="a327"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;*</span></div></li>
<li><div class="src-line"><a name="a328"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;*&nbsp;</span><span class="src-doc-coretag">@param&nbsp;</span><span class="src-doc-type">int&nbsp;</span><span class="src-doc">the&nbsp;offset.&nbsp;&nbsp;The&nbsp;rational&nbsp;found&nbsp;at&nbsp;offset&nbsp;will&nbsp;be</span></div></li>
<li><div class="src-line"><a name="a329"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;*&nbsp;&nbsp;returned&nbsp;as&nbsp;an&nbsp;array.&nbsp;&nbsp;There&nbsp;must&nbsp;be&nbsp;at&nbsp;least&nbsp;eight&nbsp;bytes</span></div></li>
<li><div class="src-line"><a name="a330"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;*&nbsp;&nbsp;available&nbsp;beginning&nbsp;at&nbsp;the&nbsp;offset&nbsp;given.</span></div></li>
<li><div class="src-line"><a name="a331"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;*</span></div></li>
<li><div class="src-line"><a name="a332"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;*&nbsp;</span><span class="src-doc-coretag">@return&nbsp;</span><span class="src-doc-type">array&nbsp;</span><span class="src-doc">the&nbsp;unsigned&nbsp;rational&nbsp;found&nbsp;at&nbsp;offset,&nbsp;e.g.,&nbsp;an</span></div></li>
<li><div class="src-line"><a name="a333"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;*&nbsp;&nbsp;array&nbsp;with&nbsp;two&nbsp;integers&nbsp;in&nbsp;the&nbsp;range&nbsp;0&nbsp;to&nbsp;4294967295.</span></div></li>
<li><div class="src-line"><a name="a334"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;*</span></div></li>
<li><div class="src-line"><a name="a335"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;*&nbsp;</span><span class="src-doc-coretag">@param&nbsp;</span><span class="src-doc-type">PelByteOrder&nbsp;</span><span class="src-doc">one&nbsp;of&nbsp;</span><span class="src-doc-inlinetag">{@link&nbsp;LITTLE_ENDIAN}</span><span class="src-doc">&nbsp;and&nbsp;</span><span class="src-doc-inlinetag">{@link&nbsp;}</span></div></li>
<li><div class="src-line"><a name="a336"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;*&nbsp;&nbsp;BIG_ENDIAN}.</span></div></li>
<li><div class="src-line"><a name="a337"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;*/</span></div></li>
<li><div class="src-line"><a name="a338"></a>&nbsp;&nbsp;<span class="src-key">static&nbsp;</span><span class="src-key">function&nbsp;</span><a href="../PEL/PelConvert.html#methodbytesToRational">bytesToRational</a><span class="src-sym">(</span><span class="src-var">$bytes</span><span class="src-sym">,&nbsp;</span><span class="src-var">$offset</span><span class="src-sym">,&nbsp;</span><span class="src-var">$endian</span><span class="src-sym">)&nbsp;</span><span class="src-sym">{</span></div></li>
<li><div class="src-line"><a name="a339"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">return&nbsp;</span><span class="src-key">array</span><span class="src-sym">(</span><span class="src-id">self</span><span class="src-sym">::</span><span class="src-id">bytesToLong</span><span class="src-sym">(</span><span class="src-var">$bytes</span><span class="src-sym">,&nbsp;</span><span class="src-var">$offset</span><span class="src-sym">,&nbsp;</span><span class="src-var">$endian</span><span class="src-sym">)</span><span class="src-sym">,</span></div></li>
<li><div class="src-line"><a name="a340"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-id">self</span><span class="src-sym">::</span><span class="src-id">bytesToLong</span><span class="src-sym">(</span><span class="src-var">$bytes</span><span class="src-sym">,&nbsp;</span><span class="src-var">$offset</span>+<span class="src-num">4</span><span class="src-sym">,&nbsp;</span><span class="src-var">$endian</span><span class="src-sym">))</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a341"></a>&nbsp;&nbsp;<span class="src-sym">}</span></div></li>
<li><div class="src-line"><a name="a342"></a>&nbsp;</div></li>
<li><div class="src-line"><a name="a343"></a>&nbsp;</div></li>
<li><div class="src-line"><a name="a344"></a>&nbsp;&nbsp;<span class="src-doc">/**</span></div></li>
<li><div class="src-line"><a name="a345"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;*&nbsp;Extract&nbsp;a&nbsp;signed&nbsp;rational&nbsp;from&nbsp;bytes.</span></div></li>
<li><div class="src-line"><a name="a346"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;*</span></div></li>
<li><div class="src-line"><a name="a347"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;*&nbsp;</span><span class="src-doc-coretag">@param&nbsp;</span><span class="src-doc-type">string&nbsp;</span><span class="src-doc">the&nbsp;bytes.</span></div></li>
<li><div class="src-line"><a name="a348"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;*</span></div></li>
<li><div class="src-line"><a name="a349"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;*&nbsp;</span><span class="src-doc-coretag">@param&nbsp;</span><span class="src-doc-type">int&nbsp;</span><span class="src-doc">the&nbsp;offset.&nbsp;&nbsp;The&nbsp;rational&nbsp;found&nbsp;at&nbsp;offset&nbsp;will&nbsp;be</span></div></li>
<li><div class="src-line"><a name="a350"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;*&nbsp;&nbsp;returned&nbsp;as&nbsp;an&nbsp;array.&nbsp;&nbsp;There&nbsp;must&nbsp;be&nbsp;at&nbsp;least&nbsp;eight&nbsp;bytes</span></div></li>
<li><div class="src-line"><a name="a351"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;*&nbsp;&nbsp;available&nbsp;beginning&nbsp;at&nbsp;the&nbsp;offset&nbsp;given.</span></div></li>
<li><div class="src-line"><a name="a352"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;*</span></div></li>
<li><div class="src-line"><a name="a353"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;*&nbsp;</span><span class="src-doc-coretag">@return&nbsp;</span><span class="src-doc-type">array&nbsp;</span><span class="src-doc">the&nbsp;signed&nbsp;rational&nbsp;found&nbsp;at&nbsp;offset,&nbsp;e.g.,&nbsp;an&nbsp;array</span></div></li>
<li><div class="src-line"><a name="a354"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;*&nbsp;&nbsp;with&nbsp;two&nbsp;integers&nbsp;in&nbsp;the&nbsp;range&nbsp;-2147483648&nbsp;to&nbsp;2147483647.</span></div></li>
<li><div class="src-line"><a name="a355"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;*</span></div></li>
<li><div class="src-line"><a name="a356"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;*&nbsp;</span><span class="src-doc-coretag">@param&nbsp;</span><span class="src-doc-type">PelByteOrder&nbsp;</span><span class="src-doc">one&nbsp;of&nbsp;</span><span class="src-doc-inlinetag">{@link&nbsp;LITTLE_ENDIAN}</span><span class="src-doc">&nbsp;and&nbsp;</span><span class="src-doc-inlinetag">{@link&nbsp;}</span></div></li>
<li><div class="src-line"><a name="a357"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;*&nbsp;&nbsp;BIG_ENDIAN}.</span></div></li>
<li><div class="src-line"><a name="a358"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;*/</span></div></li>
<li><div class="src-line"><a name="a359"></a>&nbsp;&nbsp;<span class="src-key">static&nbsp;</span><span class="src-key">function&nbsp;</span><a href="../PEL/PelConvert.html#methodbytesToSRational">bytesToSRational</a><span class="src-sym">(</span><span class="src-var">$bytes</span><span class="src-sym">,&nbsp;</span><span class="src-var">$offset</span><span class="src-sym">,&nbsp;</span><span class="src-var">$endian</span><span class="src-sym">)&nbsp;</span><span class="src-sym">{</span></div></li>
<li><div class="src-line"><a name="a360"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">return&nbsp;</span><span class="src-key">array</span><span class="src-sym">(</span><span class="src-id">self</span><span class="src-sym">::</span><span class="src-id">bytesToSLong</span><span class="src-sym">(</span><span class="src-var">$bytes</span><span class="src-sym">,&nbsp;</span><span class="src-var">$offset</span><span class="src-sym">,&nbsp;</span><span class="src-var">$endian</span><span class="src-sym">)</span><span class="src-sym">,</span></div></li>
<li><div class="src-line"><a name="a361"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-id">self</span><span class="src-sym">::</span><span class="src-id">bytesToSLong</span><span class="src-sym">(</span><span class="src-var">$bytes</span><span class="src-sym">,&nbsp;</span><span class="src-var">$offset</span>+<span class="src-num">4</span><span class="src-sym">,&nbsp;</span><span class="src-var">$endian</span><span class="src-sym">))</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a362"></a>&nbsp;&nbsp;<span class="src-sym">}</span></div></li>
<li><div class="src-line"><a name="a363"></a>&nbsp;</div></li>
<li><div class="src-line"><a name="a364"></a>&nbsp;</div></li>
<li><div class="src-line"><a name="a365"></a>&nbsp;&nbsp;<span class="src-doc">/**</span></div></li>
<li><div class="src-line"><a name="a366"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;*&nbsp;Format&nbsp;bytes&nbsp;for&nbsp;dumping.</span></div></li>
<li><div class="src-line"><a name="a367"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;*</span></div></li>
<li><div class="src-line"><a name="a368"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;*&nbsp;This&nbsp;method&nbsp;is&nbsp;for&nbsp;debug&nbsp;output,&nbsp;it&nbsp;will&nbsp;format&nbsp;a&nbsp;string&nbsp;as&nbsp;a</span></div></li>
<li><div class="src-line"><a name="a369"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;*&nbsp;hexadecimal&nbsp;dump&nbsp;suitable&nbsp;for&nbsp;display&nbsp;on&nbsp;a&nbsp;terminal.&nbsp;&nbsp;The&nbsp;output</span></div></li>
<li><div class="src-line"><a name="a370"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;*&nbsp;is&nbsp;printed&nbsp;directly&nbsp;to&nbsp;standard&nbsp;out.</span></div></li>
<li><div class="src-line"><a name="a371"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;*</span></div></li>
<li><div class="src-line"><a name="a372"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;*&nbsp;</span><span class="src-doc-coretag">@param&nbsp;</span><span class="src-doc-type">string&nbsp;</span><span class="src-doc">the&nbsp;bytes&nbsp;that&nbsp;will&nbsp;be&nbsp;dumped.</span></div></li>
<li><div class="src-line"><a name="a373"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;*</span></div></li>
<li><div class="src-line"><a name="a374"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;*&nbsp;</span><span class="src-doc-coretag">@param&nbsp;</span><span class="src-doc-type">int&nbsp;</span><span class="src-doc">the&nbsp;maximum&nbsp;number&nbsp;of&nbsp;bytes&nbsp;to&nbsp;dump.&nbsp;&nbsp;If&nbsp;this&nbsp;is&nbsp;left</span></div></li>
<li><div class="src-line"><a name="a375"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;*&nbsp;&nbsp;out&nbsp;(or&nbsp;left&nbsp;to&nbsp;the&nbsp;default&nbsp;of&nbsp;0),&nbsp;then&nbsp;the&nbsp;entire&nbsp;string&nbsp;will&nbsp;be</span></div></li>
<li><div class="src-line"><a name="a376"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;*&nbsp;&nbsp;dumped.</span></div></li>
<li><div class="src-line"><a name="a377"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;*/</span></div></li>
<li><div class="src-line"><a name="a378"></a>&nbsp;&nbsp;<span class="src-key">static&nbsp;</span><span class="src-key">function&nbsp;</span><a href="../PEL/PelConvert.html#methodbytesToDump">bytesToDump</a><span class="src-sym">(</span><span class="src-var">$bytes</span><span class="src-sym">,&nbsp;</span><span class="src-var">$max&nbsp;</span>=&nbsp;<span class="src-num">0</span><span class="src-sym">)&nbsp;</span><span class="src-sym">{</span></div></li>
<li><div class="src-line"><a name="a379"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$s&nbsp;</span>=&nbsp;<a href="http://www.php.net/strlen">strlen</a><span class="src-sym">(</span><span class="src-var">$bytes</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a380"></a>&nbsp;</div></li>
<li><div class="src-line"><a name="a381"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">if&nbsp;</span><span class="src-sym">(</span><span class="src-var">$max&nbsp;</span>&gt;&nbsp;<span class="src-num">0</span><span class="src-sym">)</span></div></li>
<li><div class="src-line"><a name="a382"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$s&nbsp;</span>=&nbsp;<a href="http://www.php.net/min">min</a><span class="src-sym">(</span><span class="src-var">$max</span><span class="src-sym">,&nbsp;</span><span class="src-var">$s</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a383"></a>&nbsp;</div></li>
<li><div class="src-line"><a name="a384"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$line&nbsp;</span>=&nbsp;<span class="src-num">24</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a385"></a>&nbsp;</div></li>
<li><div class="src-line"><a name="a386"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">for&nbsp;</span><span class="src-sym">(</span><span class="src-var">$i&nbsp;</span>=&nbsp;<span class="src-num">0</span><span class="src-sym">;&nbsp;</span><span class="src-var">$i&nbsp;</span>&lt;&nbsp;<span class="src-var">$s</span><span class="src-sym">;&nbsp;</span><span class="src-var">$i</span>++<span class="src-sym">)&nbsp;</span><span class="src-sym">{</span></div></li>
<li><div class="src-line"><a name="a387"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a href="http://www.php.net/printf">printf</a><span class="src-sym">(</span><span class="src-str">'%02X&nbsp;'</span><span class="src-sym">,&nbsp;</span><a href="http://www.php.net/ord">ord</a><span class="src-sym">(</span><span class="src-var">$bytes</span><span class="src-sym">{</span><span class="src-var">$i</span><span class="src-sym">}</span><span class="src-sym">))</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a388"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</div></li>
<li><div class="src-line"><a name="a389"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">if&nbsp;</span><span class="src-sym">((</span><span class="src-var">$i</span>+<span class="src-num">1</span><span class="src-sym">)&nbsp;</span>%&nbsp;<span class="src-var">$line&nbsp;</span>==&nbsp;<span class="src-num">0</span><span class="src-sym">)</span></div></li>
<li><div class="src-line"><a name="a390"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;print<span class="src-sym">(</span><span class="src-str">&quot;\n&quot;</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a391"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">}</span></div></li>
<li><div class="src-line"><a name="a392"></a>&nbsp;&nbsp;&nbsp;&nbsp;print<span class="src-sym">(</span><span class="src-str">&quot;\n&quot;</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a393"></a>&nbsp;&nbsp;<span class="src-sym">}</span></div></li>
<li><div class="src-line"><a name="a394"></a>&nbsp;</div></li>
<li><div class="src-line"><a name="a395"></a><span class="src-sym">}</span></div></li>
<li><div class="src-line"><a name="a396"></a>&nbsp;</div></li>
<li><div class="src-line"><a name="a397"></a><span class="src-php">?&gt;</span></div></li>
</ol></div>
</div>
	<p class="notes" id="credit">
		Documentation generated on Tue, 19 Dec 2006 01:08:15 +0100 by <a href="http://www.phpdoc.org" target="_blank">phpDocumentor 1.3.0</a>
                <a target="_top" href="http://sourceforge.net/"><img src="http://sourceforge.net/sflogo.php?group_id=108380&amp;type=1" width="88" height="31" border="0" align="right" alt="SourceForge.net Logo" /></a>
	</p>
	</body>
</html>
Return current item: PEL: PHP Exif Library