title: How do I parse out n-bit elements from a byte addressable array
body: <p>I have a data stream that is addressable only in 8-bit bytes, I want to parse it out into 6-bit elements and store that into an array.  Is there any best known methods to do this?</p>
  
  <pre><code>11110000 10101010 11001100 
  </code></pre>
  
  <p>into</p>
  
  <p>an array like   </p>
  
  <pre><code>111100|001010|101011|001100
  </code></pre>
  
  <p>(can have zero padding, just needs to be addressable this way)</p>
  
  <p>and the data is an  8-bit array that is also a multiple of 6-bits , not really endless</p>