Match changes to DSet.java streaming implementation.

git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@3939 542714f4-19e9-0310-aa3c-eee0fc999fb1
This commit is contained in:
Ray Greenwell
2006-03-11 02:49:02 +00:00
parent 7336f11d6f
commit 9f2ff310e7
+7 -3
View File
@@ -222,15 +222,19 @@ public class DSet
// documentation inherited from interface Streamable
public function writeObject (out :ObjectOutputStream) :void
{
out.writeObject(_entries);
out.writeInt(_entries.length);
for (var ii :int = 0; ii < _entries.length; ii++) {
out.writeObject(_entries[ii]);
}
}
// documentation inherited from interface Streamable
public function readObject (ins :ObjectInputStream) :void
{
_entries = (ins.readObject() as TypedArray);
_entries.length = ins.readInt(); // then read the length and limit it
_entries.length = ins.readInt();
for (var ii :int = 0; ii < _entries.length; ii++) {
_entries[ii] = ins.readObject();
}
}
/** The entries of the set (in a sparse array). */