ea0a3dce06
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
36 lines
828 B
ActionScript
36 lines
828 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 Number objects.
|
|
*/
|
|
public class NumberStreamer extends Streamer
|
|
{
|
|
public function NumberStreamer ()
|
|
{
|
|
super(Number, "java.lang.Double");
|
|
}
|
|
|
|
public override function createObject (ins :ObjectInputStream) :Object
|
|
{
|
|
return ins.readDouble();
|
|
}
|
|
|
|
public override function writeObject (obj :Object, out :ObjectOutputStream)
|
|
:void
|
|
{
|
|
var n :Number = (obj as Number);
|
|
out.writeDouble(n);
|
|
}
|
|
|
|
public override function readObject (obj :Object, ins :ObjectInputStream)
|
|
:void
|
|
{
|
|
// nothing here, the Number is fully read in createObject()
|
|
}
|
|
}
|
|
}
|