Files
narya/src/as/com/threerings/io/streamers/IntStreamer.as
T
Ray Greenwell 1d36299e3c Some work on streaming.
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@3855 542714f4-19e9-0310-aa3c-eee0fc999fb1
2006-02-15 01:41:14 +00:00

34 lines
763 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 int objects.
*/
public class IntStreamer extends Streamer
{
public function IntStreamer ()
{
super(int, "java.lang.Integer");
}
public override function createObject (ins :ObjectInputStream) :*
{
return ins.readInt();
}
public override function writeObject (obj :*, out :ObjectOutputStream) :void
{
var i :int = (obj as int);
out.writeInt(i);
}
public override function readObject (obj :*, ins :ObjectInputStream) :void
{
// nothing here, the int is fully read in createObject()
}
}
}