title: Convert byte array to string with equivalent number of bytes
body: <p>Is it possible to convert a byte array to a string but where the length of the string is exactly the same length as the number of bytes in the array? If I use the following:</p>
  
  <pre><code>byte[] data; // Fill it with data
  data.toString();
  </code></pre>
  
  <p>The length of the string is different than the length of the array. I believe that this is because Java and/or Android takes some kind of default encoding into account. The values in the array can be negative as well. Theoretically it should be possible to convert any byte to some character. I guess I need to figure out how to specify an encoding that generates a fixed single byte width for each character.</p>
  
  <p><strong>EDIT:</strong></p>
  
  <p>I tried the following but it didn't work:</p>
  
  <pre><code>byte[] textArray; // Fill this with some text.
  String textString = new String(textArray, "ASCII"); 
  textArray = textString.getBytes("ASCII"); // textArray ends up with different data.
  </code></pre>