System.IO.BinaryReader reads values ββin little-endian format.
I have a C # application connecting to my own server-side network library. The server side sends everything in order of the network byte, as expected, but I think that dealing with this on the client side is inconvenient, especially for unsigned values.
UInt32 length = (UInt32)IPAddress.NetworkToHostOrder(reader.ReadInt32());
is the only way I got the correct unsigned value from the stream, but it seems awkward and ugly, and I still have to check if it will just click from high values, so I need to have some fun with BitConverter things.
Is there some way that I am missing the description of the wrapper around everything to avoid these ugly conversions on every read? It seems like there should be an endian-ness option for the reader to make this easier, but I haven't seen anything.
Zach lute
source share