views:

279

answers:

1
+2  Q: 

Little/Big Endian

How can I determine if the OS is little/big endian in Java?

+20  A: 

Check whether java.nio.ByteOrder.nativeOrder() is equal to ByteOrder.LITTLE_ENDIAN or ByteOrder.BIG_ENDIAN.

SLaks
Thank you very much. That helped
rupa
Then mark it accepted by clicking the check
SLaks
@rupa By marking an answer will get you additional 2 points :)
Boris Pavlović
+1 for having the gumption to ask the OP to "accept" an answer.
erickson
Much like erickson, +1 - both for the correct answer, and the gumption :)
aperkins
+1 because I dont think we're going to see 'rupa' on this forum again..
Ryan Fernandes