title: C++: How to read and write multi-byte integer values in a platform-independent way?
body: <p>I'm developing a simple protocol that is used to read/write integer values from/to a buffer.  The vast majority of integers are below 128, but much larger values are possible, so I'm looking at some form of multi-byte encoding to store the values in a concise way.</p>
  
  <p>What is the simplest and fastest way to read/write multi-byte values in a platform-independent (i.e. byte order agnostic) way?</p>