Exemplo n.º 1
0
        public static string readString(FlashorbBinaryReader reader, ParseContext parseContext)
        {
            int len = reader.ReadVarInteger();

            if ((len & 0x1) == 0)
            {
                return((string)parseContext.getStringReference(len >> 1));
            }

            string str = reader.ReadUTF(len >> 1);

            if (str.Length == 0)
            {
                return(str);
            }

            parseContext.addStringReference(str);
            return(str);
        }
Exemplo n.º 2
0
        public IAdaptingType read(FlashorbBinaryReader reader, ParseContext parseContext)
        {
            Dictionary <object, object> properties      = new Dictionary <object, object>();
            AnonymousObject             anonymousObject = new AnonymousObject(properties);

            parseContext.addReference(anonymousObject);

            while (true)
            {
                string propName = reader.ReadUTF();
                object obj      = null;

                int dataType = reader.ReadByte();

                if (dataType.Equals(Datatypes.REMOTEREFERENCE_DATATYPE_V1) && !propName.Equals("nc"))
                {
                    obj = 0d;                     // must be an instance of Flash's Number
                }
                else
                {
                    obj = RequestParser.readData(dataType, reader, parseContext);
                }

                if (obj == null)
                {
                    break;
                }

                properties[propName] = obj;
            }

            if (properties.Count == 1 && properties.ContainsKey("nc"))
            {
                return((IAdaptingType)properties["nc"]);
            }

            return(anonymousObject);
        }
Exemplo n.º 3
0
        public IAdaptingType read(FlashorbBinaryReader reader, ParseContext parseContext)
        {
            //int capacity = reader.ReadInt32();
            int capacity = reader.ReadInteger();
            Dictionary <String, Object> properties      = new Dictionary <String, Object>(capacity);
            AnonymousObject             anonymousObject = new AnonymousObject(properties);

            parseContext.addReference(anonymousObject);

            while (true)
            {
                String propName = reader.ReadUTF();
                object obj      = RequestParser.readData(reader, parseContext);

                if (obj == null)
                {
                    break;
                }

                properties[propName] = obj;
            }

            return(anonymousObject);
        }
Exemplo n.º 4
0
 public IAdaptingType read(FlashorbBinaryReader reader, ParseContext parseContext)
 {
     return(new StringType(reader.ReadUTF()));
 }
Exemplo n.º 5
0
        public IAdaptingType read(FlashorbBinaryReader reader, ParseContext parseContext)
        {
            string objectName = reader.ReadUTF();

            return(new NamedObject(objectName, objectReader.read(reader, parseContext)));
        }