A bit of simplification.

git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@3927 542714f4-19e9-0310-aa3c-eee0fc999fb1
This commit is contained in:
Ray Greenwell
2006-03-08 23:21:47 +00:00
parent 486fd770c5
commit bdfecce767
3 changed files with 14 additions and 35 deletions
@@ -111,7 +111,7 @@ public class ObjectOutputStream extends DataOutputStream
writeShort(cmap.code);
}
writeBareObject(object, cmap.streamer);
writeBareObject(object, cmap.streamer, true);
}
/**
@@ -127,19 +127,20 @@ public class ObjectOutputStream extends DataOutputStream
public void writeBareObject (Object object)
throws IOException
{
writeBareObject(object, Streamer.getStreamer(object.getClass()));
writeBareObject(object, Streamer.getStreamer(object.getClass()), true);
}
/**
* Write a {@link Streamable} instance without associated class metadata.
*/
protected void writeBareObject (Object obj, Streamer streamer)
protected void writeBareObject (
Object obj, Streamer streamer, boolean useWriter)
throws IOException
{
_current = obj;
_streamer = streamer;
try {
_streamer.writeObject(obj, this, true);
_streamer.writeObject(obj, this, useWriter);
} finally {
_current = null;
@@ -169,16 +170,6 @@ public class ObjectOutputStream extends DataOutputStream
_streamer.writeObject(_current, this, false);
}
/**
* Used by a {@link Streamer} that is writing an array of {@link
* Streamable} instances.
*/
protected void setCurrent (Streamer streamer, Object current)
{
_streamer = streamer;
_current = current;
}
/** Used to map classes to numeric codes and the {@link Streamer}
* instance used to write them. */
protected HashMap _classmap;