title: AS3: Can ByteArray return its content as a string with two bytes per unicode character?
body: <pre><code>var bytes:ByteArray = new ByteArray;
  bytes.writeInt(0);
  
  trace(bytes.length); // prints 4
  trace(bytes.toString().length); // prints 4
  </code></pre>
  
  <p>When I run the above code the output suggests that every character in the string returned by toString contains one byte from the ByteArray. This is of course great if you want to display the content of the ByteArray, but not so great if you want to send its content encoded in a string and the size of the string matters.</p>
  
  <p>Is it possible to get a string from the ByteArray where every character in the string contains two bytes from the ByteArray?</p>