So, if the array has 0xC0 as the first byte, and 0x1C as the second
byte, this should return the integer 49180.
Right?
No, you'll notice that it is also reversing the byte order. If the
byte at i is 0xC0 and i+1 is 0x1C, the int will be 0x1CC0, or 7360.
And that's pretty much the standard way of reading a bunch of ints
from a stream containing data in the opposite byte order that your
platform uses, at least at a low level. C has htons and friends to
do it for you, but I'm not sure what Java has in the way of libraries
for this. I suspect it probably does have one, but someone more Java-
inclined will have to answer.
--Levi
/*
PLUG: http://plug.org, #utah on irc.freenode.net
Unsubscribe: http://plug.org/mailman/options/plug
Don't fear the penguin.
*/