title: How to save a large array of 5 bit numbers in Java?
body: <p>How to efficiently save and access a large array of 5 bit numbers in memory?</p>
  
  <p>For example
  01100
  01101
  01110
  01111
  10000
  10001</p>
  
  <p>which I will later convert to a byte to check what number it is?</p>
  
  <p>I was thinking of just using an array of bytes but after a while this will be wasting a lot of memory as this will be a continually growing array. Also I will want to save this array efficiently. I will only be using exactly 5 bits.</p>