Some examples.
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@5961 542714f4-19e9-0310-aa3c-eee0fc999fb1
This commit is contained in:
@@ -154,11 +154,11 @@ public class ObjectInputStream
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
* Called to read an Object of a known final type into a Streamable object.
|
||||||
|
*
|
||||||
* @param type either a String representing the java type,
|
* @param type either a String representing the java type,
|
||||||
* or a Class object representing the actionscript type.
|
* or a Class object representing the actionscript type.
|
||||||
*/
|
*/
|
||||||
// TODO: this is the equivalent of marshalling something for which
|
|
||||||
// we have a basic streamer. Fill out with all the java types
|
|
||||||
public function readField (type :Object) :Object
|
public function readField (type :Object) :Object
|
||||||
//throws IOError
|
//throws IOError
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -106,7 +106,24 @@ public class ObjectOutputStream
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This is equivalent to marshalling a field for which there is a basic streamer.
|
* Called to write an object reference within a Streamable object when the type of the
|
||||||
|
* field is a final type.
|
||||||
|
*
|
||||||
|
* @example This is how you would do it, even if s and o referred to the same String object!
|
||||||
|
* <listing version="3.0">
|
||||||
|
* public class Foo
|
||||||
|
* implements Streamable
|
||||||
|
* {
|
||||||
|
* public var o :Object;
|
||||||
|
* public var s :String;
|
||||||
|
* ...
|
||||||
|
* public function writeObject (out :ObjectOutputStream) :void
|
||||||
|
* {
|
||||||
|
* out.writeObject(o);
|
||||||
|
* out.writeField(s);
|
||||||
|
* }
|
||||||
|
* }
|
||||||
|
* </listing>
|
||||||
*/
|
*/
|
||||||
public function writeField (val :Object) :void
|
public function writeField (val :Object) :void
|
||||||
//throws IOError
|
//throws IOError
|
||||||
|
|||||||
Reference in New Issue
Block a user