Le 04/06/13 01:12, Travis L Pinney a écrit :
Currently I have it set up to MMAP the files. I am still using Apache
EndianUtils for reading Little Endian values. I am not sure of the
advantage of calling foo.order(ByteOrder.LITTLE_ENDIAN) instead of using
the EndianUtils, (...snip...)

I noticed that you switched to ByteBuffer.order(ByteOrder.LITTLE_ENDIAN), thanks. For the record, the advantages are:

 * No need for external libraries, since ByteBuffer is bundled in JDK 1.4+
 * No need for additional API, since the same set of existing methods
   work in both cases
 * Potentially order of magnitude faster, since ByteBuffer.get*() with
   Little Endian order maps directly to a single CPU instruction on
   Intel processors, while I guess (but did not verified) that
   EndianUtils performs arithmetic operations for achieving equivalent
   result.


    Martin

Reply via email to