 {
     public static function encode (bytes :ByteArray, value :*) :void
     {
-        encodeValue(new Context(bytes), bytes, value);
+        encodeValue(new Context(bytes), value);
     }
 
     private static function encodeValue (context :Context, value :*) :void

            context.bytes.writeByte(0x80 | ((n >> 7) & 0x7F));
            context.bytes.writeByte(0x00 | (n & 0x7F));

        } else {
            context.bytes.writeByte(0x80 | (n >> 21));
            context.bytes.writeByte(0x80 | ((n >> 14) & 0x7F));
            context.bytes.writeByte(0x80 | ((n >> 7) & 0x7F));
            context.bytes.writeByte(0x00 | (n & 0x7F));

        }
    }



        } else if (value is Date) {
            // 0x08
            throw new Error("Date serialization not supported");

        } else if (value is Array) {
            context.bytes.writeByte(0x09);
