 package{
 	import flash.display.Sprite;
+	import flash.net.registerClassAlias;
 	import flash.text.TextField;
 	import flash.utils.ByteArray;
 

			tf.wordWrap = true;
			addChild(tf);

			var b:ByteArray = new ByteArray();
			var v:Vector.<int> = new Vector.<int>();
			for(var z:int = 0; z < 3; ++z)
				v.push(z);
			b.writeObject(v);

			dumpByteArray(b);

			var data:Array = [
				0x0d, 0x07, 0x00,
				0x00, 0x00, 0x00, 0x01,
				0x00, 0x00, 0x00, 0x02,
				0x00, 0x00, 0x00, 0x03
			];
			b = createByteArray(data);

			var o:* = b.readObject();
			tf.appendText(o + "\n");

		}
	}
}

import flash.utils.IDataInput;
import flash.utils.IDataOutput;
import flash.utils.IExternalizable;

class Foo implements IExternalizable {
	public var foo:String;

	public function Foo(s:String = "default") {
		foo = s;
	}

	public function writeExternal(output:IDataOutput):void {
		output.writeUTF(foo);
	}

	public function readExternal(input:IDataInput):void {
		foo = input.readUTF();
	}
}
