title: Most Significant Byte Computation
body: <p>I am trying to implement a four byte value (most significant data first) to compute the total length of data. I found a code snippet to compute this but I didn't get a 4 byte data in the output. Instead I only got a 2 byte value. </p>
  
  <pre><code>char bytesLen[4] ;
  unsigned int blockSize = 535;
  bytesLen[0] = (blockSize &amp; 0xFF);
  bytesLen[1] = (blockSize &gt;&gt; 8) &amp; 0xFF;
  bytesLen[2] = (blockSize &gt;&gt; 16) &amp; 0xFF;
  bytesLen[3] = (blockSize &gt;&gt; 24) &amp; 0xFF;
  
  std::cout &lt;&lt; "bytesLen: " &lt;&lt; bytesLen &lt;&lt; '\n';
  </code></pre>
  
  <p>Did I missed something in my code?</p>