title: How to write and read bytes from unsigned variable
body: <p>Here is what I'm trying to do:</p>
  
  <p>I have two integers</p>
  
  <pre><code>int a = 0; // can be 0 or 1
  int b = 3; // can be 0, 1, 2 or 3
  </code></pre>
  
  <p>Also I want to have</p>
  
  <pre><code>unsigned short c
  </code></pre>
  
  <p>to store that variables inside it.</p>
  
  <p>For example, if I would store <strong>a</strong> inside <strong>c</strong> it will be looking like this:</p>
  
  <pre><code>00000000
  ^ here is a
  </code></pre>
  
  <p>Then I need to store b inside c. And it should look like following:</p>
  
  <pre><code>011000000
   ^^ here is b.
  </code></pre>
  
  <p>Also I would like to read that numbers back after writing them.
  How can I do this?</p>
  
  <p>Thanks for your suggestions.</p>