How to check whether a system is big endian or little endian?
If you are using .NET: Check the value of BitConverter.IsLittleEndian.
BitConverter.IsLittleEndian