title: Why does to_be_bytes() and to_le_bytes() do the opposite of what I expect here?
body: <p>Maybe the question should be &quot;Why do I expect to_be_bytes() and to_le_bytes() to do the opposite here?&quot;, but anyways, here is the situation:</p>
  <pre class="lang-rust prettyprint-override"><code>fn main() {
      let buf: [u8; 2048] // Buffer I use to receive UDP messages
  
      let (_, entry, _) = unsafe { buf[14..].align_to::&lt;u16&gt;() };
      // In memory entry looks like: 00 44 16 15   21 04 03 5a   03 67 03 6a   03 64 88 91
  
      let [first, second] = entry[0].to_be_bytes();
      
      assert_eq!(first, 0x44);
      assert_eq!(second, 0x00);
  }
  </code></pre>
  <p>Shouldn't it be the opposite? Isn't big endianness like preserving the order in memory?</p>