I have run into this before, and just ran into it again, and was completely confused how a bytearray converted to a string was only 4 characters long.
The problem is, if you EVER try to append a NULL character (not the ActionScript null, but the string value of the char 0), it cuts off the end of the string when printing out in trace or displaying onstage.
HOWEVER, if you trace out the length of the string, you get the full length, so the problem arises trying to print the contents onto trace or the stage.
Here is example code to mess with:
var str:String = "";
str += "BEGIN";
str += String.fromCharCode(0);
str += "END";
trace(str); //Outputs 'BEGIN'
trace(str.length); //Outputs 9
Is there any reason Adobe has caused it to act this way?
Is this normal (like for other non-Adobe systems as well)?