Endian Conversion
Description |
|---|
To swap the byte order from Little Endian to Big Endian and vice versa this can be done like this: •16 Bit value (unsigned short): x = ((y & 0xff) << 8) | ((y & 0xff00)>> 8) •32 Bit value (unsigned int): x = ((y & 0xff) << 24) | ((y & 0xff00) << (8 0xff0000)>> 8) | ((y & 0xff000000) >> 24) |