Im using a System.IO.BinaryReader to read a data from a serialized file. The file is big endian. So what I did to read the Int64 (long) from the stream was read 8 bytes from it. What I need to do is convert those 8 bytes of big endian into little endian long representation.
I can’t use System.BitConverter as it will be compiled with Mono for use on Linux which could be running on big endian and with Visual Studio for Windows which is little endian.
You can use
System.Net.IPAddress.NetworkToHostOrderorSystem.Net.IPAddress.HostToNetworkOrderFor ex,
System.Net.IPAddress.HostToNetworkOrder(0x0123456789abcdefl)would returnefcdab8967452301