Big-Endian Processing in .Net Core
Is there BitConverter
or another class that supports the .NET core that I can read integers and other values as Big Endian encoded?
I don't like writing a bunch of helper methods:
int GetBigEndianIntegerFromByteArray(byte[] data, int startIndex) {
return (data[startIndex] << 24)
| (data[startIndex + 1] << 16)
| (data[startIndex + 2] << 8)
| data[startIndex + 3];
}
+3
source to share