title: Convert each character of a string in bits
body: <pre><code> String message= "10";
          byte[] bytes = message.getBytes();
  
          for (int n = 0; n &lt; bytes.length; n++) {
              byte b = bytes[n];
  
              for (int i = 0; i &lt; 8; i++) {//do something for each bit in my byte
              boolean bit = ((b &gt;&gt; (7 - i) &amp; 1) == 1);
              }
          }
  </code></pre>
  
  <p>My problem here is that it takes <code>1</code> and <code>0</code> as their ASCII values, <code>49</code> and <code>48</code>, instead of <code>1</code> and <code>0</code> as binary(<code>00000001</code> and <code>00000000</code>). How can I make my program treat each character from my string as a binary sequence of 8 bits?</p>
  
  <p>Basicly, I want to treat each bit of my number as a byte. I do that like this <code>byte b = bytes[n];</code> but the program treats it as the ASCII value.</p>
  
  <p>I could assign the number to an int, but then, I can't assign the bits to a byte.</p>