1d36299e3c
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@3855 542714f4-19e9-0310-aa3c-eee0fc999fb1
34 lines
763 B
ActionScript
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()
|
|
}
|
|
}
|
|
}
|