title: Converting a String representation of bits to a byte
body: <p>I'm just beginning to learn about file compression and I've run into a bit of a roadblock. I have an application that will encode a string such as "program" as a compressed binary representation <code>"010100111111011000"</code>(note this is still stored as a String).</p>
  
  <pre><code>Encoding
  g       111
  r       10
  a       110
  p       010
  o       011
  m       00
  </code></pre>
  
  <p>Now I need to write this to the file system using a <code>FileOutputStream</code>, the problem I'm having is, how can I convert the string "010100111111011000" to a <code>byte[]</code>/<code>byte</code>s to be written to the file system with <code>FileOutputStream</code>?</p>
  
  <p>I've never worked with bits/bytes before so I'm kind of at a dead end here.</p>