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); }
public static IAdaptingType readData(FlashorbBinaryReader reader, ParseContext parseContext, ITypeReader[] readers) { int type = reader.ReadByte(); return(readers[type].read(reader, parseContext)); }