title: ByteArrayOutputStream.toString() generating extra characters
body: <p>I have the following code:</p>
  <pre><code>ByteArrayOutputStream baos = new ByteArrayOutputStream();
  
  int size = 4096;
  byte[] bytes = new byte[size];
  
  while (is.read(bytes, 0, size) != -1)
  {
      baos.write(bytes);
      baos.flush();
  }
  </code></pre>
  <p>When I do:</p>
  <pre><code>String s = baos.toString();
  </code></pre>
  <p>I get <code>\u0000</code>-s appended to my string. So, if my character data is only X bytes out of Y, the Y-Z will get prefilled with <code>\u0000</code> making it impossible to check for <code>equals</code>. What am I doing wrong here? How should I be converting the bytes to a <code>String</code> in this case?</p>