Files
narya/src/as/com/threerings/io/streamers/StringStreamer.as
T
Ray Greenwell ea0a3dce06 Well, it compiles.
It's not functional, there are still large holes in the implementation.


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@3868 542714f4-19e9-0310-aa3c-eee0fc999fb1
2006-02-20 03:53:04 +00:00

36 lines
822 B
ActionScript

package com.threerings.io.streamers {
import com.threerings.io.ObjectInputStream;
import com.threerings.io.ObjectOutputStream;
import com.threerings.io.Streamer;
/**
* A Streamer for String objects.
*/
public class StringStreamer extends Streamer
{
public function StringStreamer ()
{
super(String, "java.lang.String");
}
public override function createObject (ins :ObjectInputStream) :Object
{
return ins.readUTF();
}
public override function writeObject (obj :Object, out :ObjectOutputStream)
:void
{
var s :String = (obj as String);
out.writeUTF(s);
}
public override function readObject (obj :Object, ins :ObjectInputStream)
:void
{
// nothing here, the String is fully read in createObject()
}
}
}