Some more progress.
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
This commit is contained in:
@@ -0,0 +1,35 @@
|
||||
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()
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user