title: Converting a java byte array to a String
body: <p>I'm trying to convert a java byte array to a String as follows:</p>
  
  <pre><code>byte[] byteArr = new byte[128];
  myFill(byteArr);
  String myString = new String(byteArr);
  </code></pre>
  
  <p>myFill() populates byteArr with a string that's less than 128 characters long, and byteArr is zero padded. The code fine except myString somehow converts all the zero pads to some illegible characters. myString.length() also returns 128 instead of the actual ASCII content.</p>
  
  <p>How do I rectify this?</p>
  
  <p>Thanks!</p>