Browse the notebook

Tag: byteArray

ByteArray.readUTFBytes()

var m:ByteArray = new ByteArray();
var bytes:Array = [0x41, 0x63, 0x74, 0x69, 0x6F, 0x6E, 0x20, 
				   0x53, 0x6E, 0x69, 0x70, 0x70, 0x65, 0x74]
for (var i:int = 0; i < bytes.length; i++){
	m.writeByte(bytes[i]);
}

m.position = 0;
 
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…

Read snippet: ByteArray.readUTFBytes()