More jockeying to make String[] streaming work and to make service group

registration work. Keeerist Flash is annoying.


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@4562 542714f4-19e9-0310-aa3c-eee0fc999fb1
This commit is contained in:
Michael Bayne
2007-02-12 03:40:14 +00:00
parent 40538c81ad
commit 46a23342b3
6 changed files with 66 additions and 39 deletions
@@ -1,3 +1,6 @@
//
// $Id$
package com.threerings.io {
import flash.utils.ByteArray;
@@ -86,8 +89,7 @@ public class ObjectOutputStream
}
/**
* This is equivalent to marshalling a field for which there
* is a basic streamer.
* This is equivalent to marshalling a field for which there is a basic streamer.
*/
public function writeField (val :Object) :void
//throws IOError
@@ -100,10 +102,9 @@ public class ObjectOutputStream
}
/**
* Uses the default streamable mechanism to write the contents of the
* object currently being streamed. This can only be called from
* within a <code>writeObject</code> implementation in a {@link
* Streamable} object.
* Uses the default streamable mechanism to write the contents of the object currently being
* streamed. This can only be called from within a <code>writeObject</code> implementation in a
* {@link Streamable} object.
*/
public function defaultWriteObject () :void
//throws IOError
@@ -166,8 +167,7 @@ public class ObjectOutputStream
_targ.writeUTF(value);
}
// these two are defined in IDataOutput, but have no java equivalent so
// we skip them.
// these two are defined in IDataOutput, but have no java equivalent so we skip them.
//public function writeUnsignedInt (value :int) :void
//public function writeUTFBytes (value :int) :void
+12
View File
@@ -50,6 +50,18 @@ public dynamic class TypedArray extends Array
_jtype = jtype;
}
/**
* Adds all of the elements of the supplied array to this typed array. The types of the
* elements of the target array must, of course, be of the type specified for this array
* otherwise badness will ensue.
*/
public function addAll (other :Array) :void
{
for (var ii :int = 0; ii < other.length; ii++) {
this[ii] = other[ii];
}
}
public function getJavaType () :String
{
return _jtype;
@@ -30,6 +30,9 @@ public class ArrayStreamer extends Streamer
baseClass = Translations.getFromServer(baseClass);
_elementType = ClassUtil.getClassByName(baseClass);
_isFinal = ClassUtil.isFinal(_elementType);
if (_elementType == String) {
_delegate = new StringStreamer();
}
} else if (secondChar === "I") {
_elementType = int;
@@ -76,8 +79,7 @@ public class ArrayStreamer extends Streamer
return ta;
}
override public function writeObject (obj :Object, out :ObjectOutputStream)
:void
override public function writeObject (obj :Object, out :ObjectOutputStream) :void
{
var arr :Array = (obj as Array);
var ii :int;
@@ -115,8 +117,7 @@ public class ArrayStreamer extends Streamer
}
}
override public function readObject (obj :Object, ins :ObjectInputStream)
:void
override public function readObject (obj :Object, ins :ObjectInputStream) :void
{
var arr :Array = (obj as Array);
var ii :int;