I have an array of bytes representing a picture(bgra). I'd like to know which is the order for the bytes in a c# byte[]. Are the bytes represented in little or big endian ?
Thank you for reading.
I have an array of bytes representing a picture(bgra). I'd like to know which is the order for the bytes in a c# byte[]. Are the bytes represented in little or big endian ?
Thank you for reading.
Luke's is right but ii wonder if one could write code to prove it (wihout BitConvert.IsLittleEndian )
ushort word = 0x0001; // 16bit word with lsb set
var bits = new BitArray(BitConvert.GetBytes());
if (bits[0]) {
// little endian
} else if (bits[8]) {
// big endian
}
edit for Sinatr
Windows is little endian, so if you are running c# you are probably using little endian