251566b321
- Specify override first on overridden methods. git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@4170 542714f4-19e9-0310-aa3c-eee0fc999fb1
38 lines
853 B
ActionScript
38 lines
853 B
ActionScript
package com.threerings.io.streamers {
|
|
|
|
import com.threerings.util.Float;
|
|
|
|
import com.threerings.io.ObjectInputStream;
|
|
import com.threerings.io.ObjectOutputStream;
|
|
import com.threerings.io.Streamer;
|
|
|
|
/**
|
|
* A Streamer for Float objects.
|
|
*/
|
|
public class FloatStreamer extends Streamer
|
|
{
|
|
public function FloatStreamer ()
|
|
{
|
|
super(Float, "java.lang.Float");
|
|
}
|
|
|
|
override public function createObject (ins :ObjectInputStream) :Object
|
|
{
|
|
return new Float(ins.readFloat());
|
|
}
|
|
|
|
override public function writeObject (obj :Object, out :ObjectOutputStream)
|
|
:void
|
|
{
|
|
var float :Float = (obj as Float);
|
|
out.writeFloat(float.value);
|
|
}
|
|
|
|
override public function readObject (obj :Object, ins :ObjectInputStream)
|
|
:void
|
|
{
|
|
// unneeded, done in createObject
|
|
}
|
|
}
|
|
}
|