title: Convert a ushort value into two byte values in C#
body: <p>How do I split a ushort into two byte variables in C#?</p>
  
  <p>I tried the following (package.FrameID is ushort):</p>
  
  <p>When I try to calculate this with paper&amp;pencil I get the right result. Also, if FrameID is larger than a byte (so the second byte isn't zero), it works.</p>
  
  <pre><code>array[0] = (byte)(0x0000000011111111 &amp; package.FrameID);
  array[1] = (byte)(package.FrameID &gt;&gt; 8);
  </code></pre>
  
  <p>In my case package.FrameID is 56 and the result in array[0] is 16 instead of 56.</p>
  
  <p>How can I fix this?</p>