Started work on the 'crowd' package.
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@3935 542714f4-19e9-0310-aa3c-eee0fc999fb1
This commit is contained in:
@@ -0,0 +1,37 @@
|
||||
package com.threerings.io.streamers {
|
||||
|
||||
import com.threerings.util.Byte;
|
||||
|
||||
import com.threerings.io.ObjectInputStream;
|
||||
import com.threerings.io.ObjectOutputStream;
|
||||
import com.threerings.io.Streamer;
|
||||
|
||||
/**
|
||||
* A Streamer for Byte objects.
|
||||
*/
|
||||
public class ByteStreamer extends Streamer
|
||||
{
|
||||
public function ByteStreamer ()
|
||||
{
|
||||
super(Byte, "java.lang.Byte");
|
||||
}
|
||||
|
||||
public override function createObject (ins :ObjectInputStream) :Object
|
||||
{
|
||||
return new Byte(ins.readByte());
|
||||
}
|
||||
|
||||
public override function writeObject (obj :Object, out :ObjectOutputStream)
|
||||
:void
|
||||
{
|
||||
var byte :Byte = (obj as Byte);
|
||||
out.writeByte(byte.value);
|
||||
}
|
||||
|
||||
public override function readObject (obj :Object, ins :ObjectInputStream)
|
||||
:void
|
||||
{
|
||||
// unneeded, done in createObject
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user