...
This compliant solution assumes that the values read are 32-bit unsigned integers. It reads an unsigned integer value into a long
variable using the readInt()
method. The readInt()
method assumes signed values and returns a signed Java int
; the return value is converted to a long
with sign extension. The code uses an &
operation to mask off the upper 32-bits of the long; this produces a value in the range of a 32-bit unsigned integer, as intended. The mask size should be chosen to match the size of the unsigned integer values being read.
...
<ac:structured-macro ac:name="unmigrated-wiki-markup" ac:schema-version="1" ac:macro-id="85b37da824cb79ac-749c06f1-444d43b4-b97cb84a-f132939e557d6537ee354b64"><ac:plain-text-body><![CDATA[ | [[API 2006 | AA. Bibliography#API 06]] | Class DataInputStream: method | ]]></ac:plain-text-body></ac:structured-macro> |
<ac:structured-macro ac:name="unmigrated-wiki-markup" ac:schema-version="1" ac:macro-id="1ad17cb308a98390-d7c65311-4edf4139-9f419940-c430761276d38686fd0b3b77"><ac:plain-text-body><![CDATA[ | [[Harold 1997 | AA. Bibliography#Harold 97]] | Chapter 2: Primitive Data Types, Cross Platform Issues, Unsigned Integers | ]]></ac:plain-text-body></ac:structured-macro> |
<ac:structured-macro ac:name="unmigrated-wiki-markup" ac:schema-version="1" ac:macro-id="10fee8f10073706f-fe5a5383-49454525-969eaed3-dd44ede1cf767e51314fc992"><ac:plain-text-body><![CDATA[ | [[Hitchens 2002 | AA. Bibliography#Hitchens 02]] | 2.4.5 Accessing Unsigned Data | ]]></ac:plain-text-body></ac:structured-macro> |
...