Help on getting at the bytes of an int
I'd like to do something like:
byte i32 = toBytes (myInt, littleEndian);
and the reverse:
byte i32 = ...
int myInt = toInt (i32, littleEndian);
Is there any way to do it simply in Java. The only way I can figure out right now involves IO streams, which seems like a lot of typing (and computation) for just this simple thing.