title: How can one simplify network byte-order conversion from a BinaryReader?
body: <p>System.IO.BinaryReader reads values in a little-endian format.</p>
  
  <p>I have a C# application connecting to a proprietary networking library on the server side.  The server-side sends everything down in network byte order, as one would expect, but I find that dealing with this on the client side is awkward, particularly for unsigned values.</p>
  
  <pre><code>UInt32 length = (UInt32)IPAddress.NetworkToHostOrder(reader.ReadInt32());
  </code></pre>
  
  <p>is the only way I've come up with to get a correct unsigned value out of the stream, but this seems both awkward and ugly, and I have yet to test if that's just going to clip off high-order values so that I have to do fun BitConverter stuff.</p>
  
  <p>Is there some way I'm missing short of writing a wrapper around the whole thing to avoid these ugly conversions on every read?  It seems like there should be an endian-ness option on the reader to make things like this simpler, but I haven't come across anything.</p>