Tag Archives: byteArray

ByteArray.readUTFBytes()

Actionscript:
  1. var m:ByteArray = new ByteArray();
  2. var bytes:Array = [0x41, 0x63, 0x74, 0x69, 0x6F, 0x6E, 0x20,
  3.                    0x53, 0x6E, 0x69, 0x70, 0x70, 0x65, 0x74]
  4. for (var i:int = 0; i <bytes.length; i++){
  5.     m.writeByte(bytes[i]);
  6. }
  7.  
  8. m.position = 0;
  9.  
  10. trace(m.readUTFBytes(bytes.length));

I was messing around with a hex editor today and decided to start playing with ByteArray for the first time in awhile. Just wrote this as a little warm up... Try running it to see what it traces out...

Posted in Uncategorized | Also tagged , , | 2 Comments