diff --git a/src/as/com/threerings/util/FlashObjectMarshaller.as b/src/as/com/threerings/util/FlashObjectMarshaller.as deleted file mode 100644 index ce9a1f1ca..000000000 --- a/src/as/com/threerings/util/FlashObjectMarshaller.as +++ /dev/null @@ -1,64 +0,0 @@ -package com.threerings.util { - -import flash.net.ObjectEncoding; - -import flash.system.ApplicationDomain; - -import flash.utils.ByteArray; -import flash.utils.Endian; - -import com.threerings.io.TypedArray; - -/** - * Utility methods for transferring flash properties via - * the presents dobj system. - */ -public class FlashObjectMarshaller -{ - public static function encode ( - obj :Object, encodeArrayElements :Boolean = true) :Object - { - if (obj == null) { - return null; - } - if (encodeArrayElements && obj is Array) { - var src :Array = (obj as Array); - var dest :TypedArray = TypedArray.create(ByteArray); - for each (var o :Object in src) { - dest.push(encode(o, false)); - } - return dest; - } - - // TODO: Our own encoding, that takes into account - // the ApplicationDomain - var bytes :ByteArray = new ByteArray(); - bytes.endian = Endian.BIG_ENDIAN; - bytes.objectEncoding = ObjectEncoding.AMF3; - bytes.writeObject(obj); - return bytes; - } - - public static function decode (encoded :Object) :Object - { - if (encoded == null) { - return null; - } - if (encoded is TypedArray) { - var src :TypedArray = (encoded as TypedArray); - var dest :Array = []; - for each (var b :ByteArray in src) { - dest.push(decode(b)); - } - return dest; - } - var bytes :ByteArray = (encoded as ByteArray); - - // TODO: Our own decoding, that takes into account - // the ApplicationDomain - bytes.endian = Endian.BIG_ENDIAN; - bytes.objectEncoding = ObjectEncoding.AMF3; - return bytes.readObject(); - } -} -}