More progress.

git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@3861 542714f4-19e9-0310-aa3c-eee0fc999fb1
This commit is contained in:
Ray Greenwell
2006-02-17 05:11:31 +00:00
parent cd7e127bc6
commit 74c35b6d65
22 changed files with 1632 additions and 19 deletions
@@ -63,7 +63,7 @@ public class ObjectInputStream
var target :*;
if (cmap.streamer === null) {
var clazz :Class = flash.util.getClassByName(cmap.cname);
var clazz :Class = flash.util.getClassByName(cmap.classname);
target = new clazz();
} else {
@@ -87,8 +87,7 @@ public class ObjectInputStream
{
// streamable objects
if (streamer == null) {
var sable :Streamable = (obj as Streamable);
sable.readObject(this);
obj.readObject(this); // obj is a Streamable.
return;
}
@@ -117,7 +116,7 @@ public class ObjectInputStream
public function defaultReadObject () :void
//throws IOError
{
_streamer.readObject(_current, this, false);
_streamer.readObject(_current, this);
}
public function readBoolean () :Boolean
@@ -29,6 +29,7 @@ public class ObjectOutputStream
// create a class mapping if we've not got one
if (cmap === undefined) {
var streamer :Streamer = Streamer.getStreamer(obj);
// streamer may be null to indicate a Streamable object
if (streamer === undefined) {
// TODO
trace("OMG, cannot stream ", cname);
@@ -60,8 +61,7 @@ public class ObjectOutputStream
{
// if it's Streamable, it goes straight through
if (streamer == null) {
var sable :Streamable = (obj as Streamable);
sable.writeObject(this);
obj.writeObject(this); // obj is a Streamable
return;
}
@@ -101,7 +101,7 @@ public class ObjectOutputStream
}
// write the instance data
_streamer.writeObject(_current, this, false)
_streamer.writeObject(_current, this);
}
public function writeBoolean (value :Boolean) :void
+4 -8
View File
@@ -40,11 +40,9 @@ public class Streamer
createStreamers();
}
var s :Streamer;
for (var ii :int = 0; ii < _streamers.lenght; ii++) {
s = (_streamers[ii] as Streamer);
if (s.isStreamerFor(obj)) {
return s;
if (_streamers[ii].isStreamerFor(obj)) {
return _streamers[ii];
}
}
@@ -57,11 +55,9 @@ public class Streamer
createStreamers();
}
var s :Streamer;
for (var ii :int = 0; ii < _streamers.length; ii++) {
s = (_streamers[ii] as Streamer);
if (s.getJavaClassName() === jname) {
return s;
if (_streamers[ii].getJavaClassName() === jname) {
return _streamers[ii];
}
}