The readField()/writeField() methods are for marshalling objects that have
basic streamers defined for them (String, Integer, Boolean) and not other arbitrary objects. git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@3863 542714f4-19e9-0310-aa3c-eee0fc999fb1
This commit is contained in:
@@ -49,35 +49,14 @@ public class Name extends Object
|
||||
public function writeObject (out :ObjectOutputStream) :void
|
||||
//throws IOError
|
||||
{
|
||||
/*
|
||||
// TODO: oh shit, this is wrong. We need to write a boolean out
|
||||
// indicating whether the object that follows is null or not
|
||||
out.writeBareObject(_name);
|
||||
*/
|
||||
|
||||
out.writeField(_name);
|
||||
|
||||
// we need a way of doing the following automatically:
|
||||
/*
|
||||
var b :Boolean = (_name != null);
|
||||
out.writeBoolean(b);
|
||||
if (b) {
|
||||
out.writeUTF(_name);
|
||||
}
|
||||
*/
|
||||
}
|
||||
|
||||
// documentation inherited from interface Streamable
|
||||
public function readObject (ins :ObjectInputStream) :void
|
||||
//throws IOError
|
||||
{
|
||||
// TODO: oh shit, this is wrong
|
||||
_name = ins.readField(String);
|
||||
|
||||
/*
|
||||
var b :Boolean = in.readBoolean();
|
||||
_name = b ? in.readUTF() : null;
|
||||
*/
|
||||
}
|
||||
|
||||
protected function normalize (txt :String) :String
|
||||
|
||||
Reference in New Issue
Block a user