85d56cceec
I still need to work on the Streaming, but I've figured out how to do a bit of introspection which will be necessary when streaming an array. Started working on the client classes, did ClientObserver and SessionObserver stuff using flash's event notification system. git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@3846 542714f4-19e9-0310-aa3c-eee0fc999fb1
36 lines
827 B
ActionScript
36 lines
827 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 String objects.
|
|
*/
|
|
public class StringStreamer extends Streamer
|
|
{
|
|
public function StringStreamer ()
|
|
{
|
|
super(String);
|
|
}
|
|
|
|
public override function createObject (ins :ObjectInputStream) :*
|
|
{
|
|
return ins.readUTF();
|
|
}
|
|
|
|
public override function writeObject (obj :*, out :ObjectOutputStream,
|
|
useWriter :Boolean) :void
|
|
{
|
|
var s :String = (obj as String);
|
|
out.writeUTF(s);
|
|
}
|
|
|
|
public override function readObject (obj :*, ins :ObjectInputStream,
|
|
useReader :Boolean) :void
|
|
{
|
|
// nothing here, the String is fully read in createObject()
|
|
}
|
|
}
|
|
}
|