title: left/right bitwise shifts - why do we shift by byte length
body: <p>I have been reading this blog about bit manipulation in networking packages. I have this code and I am seeing that its reading in an integer which is typically 4 bytes long (32 bits)</p>
  <pre class="lang-java prettyprint-override"><code>public int readInt() {
      return (pData[caret++] &amp; 0xff) &lt;&lt; 24 | (pData[caret++] &amp; 0xff) &lt;&lt; 16
              | (pData[caret++] &amp; 0xff) &lt;&lt; 8 | pData[caret++] &amp; 0xff;
  }
  
  </code></pre>
  <p>Why are we moving by 8, 16 and 24 when reading in an integer value? What is the goal and what does it achieve?</p>