I have the following requirement. I will be receiving data from a legacy system which uses Little endian byte ordering. Hence the data will be in little endian order. I am trying to use a ByteBuffer of the Java.nio to convert the data from little endian to Big endian. For Instance let me say that I have a byte array [0x80,0x01] and lets say this is in little endian, is it possible to use the Byte Buffer to convert the byte array to [0x01, 0x80]. What do i need to do when I receive the bytes from the legacy system in little endian order.
Byte order is only meaningful when working with data types larger than 1 byte. Setting byte order doesn't change the order of bytes inside ByteBuffer, it changes only conversion to and from longer data types.