Encode nulls as a null byte array.
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@4325 542714f4-19e9-0310-aa3c-eee0fc999fb1
This commit is contained in:
@@ -13,6 +13,12 @@ public class FlashObjectMarshaller
|
||||
{
|
||||
public static function encode (obj :Object) :ByteArray
|
||||
{
|
||||
if (obj == null) {
|
||||
return null;
|
||||
}
|
||||
|
||||
// TODO: Our own encoding, that takes into account
|
||||
// the ApplicationDomain
|
||||
var bytes :ByteArray = new ByteArray();
|
||||
bytes.endian = Endian.BIG_ENDIAN;
|
||||
bytes.objectEncoding = ObjectEncoding.AMF3;
|
||||
@@ -22,6 +28,12 @@ public class FlashObjectMarshaller
|
||||
|
||||
public static function decode (bytes :ByteArray) :Object
|
||||
{
|
||||
if (bytes == null) {
|
||||
return null;
|
||||
}
|
||||
|
||||
// TODO: Our own encoding, that takes into account
|
||||
// the ApplicationDomain
|
||||
bytes.endian = Endian.BIG_ENDIAN;
|
||||
bytes.objectEncoding = ObjectEncoding.AMF3;
|
||||
return bytes.readObject();
|
||||
|
||||
Reference in New Issue
Block a user