title: Why Byte.parseByte("10000001",2) throws a NFE?
body: <p>I have a bitmask to be stored in one byte, as I only need 8 bits. When I'm creating it I do it as a String (I thought it would be easier in this way) and then I transform it to a byte with <code>Byte.parseByte(mask,2)</code>, but I found it does not work for certain values:</p>
  
  <pre><code>String bits="10000001";
  Byte.parseByte(bits,2);// throws a NFE
  </code></pre>
  
  <p>But if I do:</p>
  
  <pre><code>byte b=(byte)0x81; //1000 0001
  </code></pre>
  
  <p>There is no problem.</p>
  
  <p>PS: I found a workaround, <code>byte b=(byte)Integer.parseInt(bits, 2);</code>but anyway I want to know why I cannot convert 8 bits into a byte</p>