title: How to read/write integer values from bytes without old_io?
body: <p>There are convenient traits <code>Reader</code> and <code>Writer</code> in <code>std::old_io</code> module to read/write integer values using various endiannes. But that module is declared as obsolete so I'm trying to figure out other ways to do that.</p>
  
  <p>The one way is to read bytes and construct result values with bit arithmetic. Is there other way in standard library? E.g. to read <code>u64</code> from <code>&amp;[u8]</code> where it's encoded in big-endian encoding. What I would do in C is to memcpy 8 bytes from a <code>uint8_t</code> array to a <code>uint64_t</code> value and then perform something like <code>htons</code> to swap bytes if necessary.</p>