Files
narya/src/as/com/threerings/util/StreamableArrayList.as
T
Ray Greenwell 4d7fb64b8c More progress.
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@3849 542714f4-19e9-0310-aa3c-eee0fc999fb1
2006-02-14 04:07:02 +00:00

31 lines
843 B
ActionScript

package com.threerings.util {
import mx.collections.ArrayCollection;
import com.threerings.io.ObjectInputStream;
import com.threerings.io.ObjectOutputStream;
import com.threerings.io.Streamable;
public class StreamableArrayList extends ArrayCollection
implements Streamable
{
// documentation inherited from interface Streamable
public function writeObject (out :ObjectOutputStream) :void
{
out.writeInt(source.length);
for (var ii :int = 0; ii < source.length; ii++) {
out.writeObject(source[ii]);
}
}
// documentation inherited from interface Streamable
public function readObject (ins :ObjectInputStream) :void
{
var ecount :int = ins.readInt();
for (var ii :int = 0; ii < ecount; ii++) {
source[ii] = ins.readObject();
}
}
}
}