Example #1
0
		public IAdaptingType read( FlashorbBinaryReader reader, ParseContext parseContext )
		{
			int length = reader.ReadInteger();
			IAdaptingType[] array = new IAdaptingType[ length ];
			ArrayType arrayType = new ArrayType( array );
			parseContext.addReference( arrayType );

			for( int i = 0; i < length; i++ )
				array[ i ] = RequestParser.readData( reader, parseContext );

			return arrayType;
		}
Example #2
0
		public IAdaptingType read( FlashorbBinaryReader reader, ParseContext parseContext )
		{
			int refId = reader.ReadVarInteger();

			if( (refId & 0x1) == 0 )
				return parseContext.getReference( refId >> 1 );

			int arraySize = refId >> 1;
			IAdaptingType adaptingType = null;
			object container = null;

			while( true )
			{
				string str = ReaderUtils.readString( reader, parseContext );

				if( str == null || str.Length == 0 )
					break;

				if( container == null )
				{
					container = new Dictionary<object, object>();
					adaptingType = new AnonymousObject( (IDictionary) container );
					parseContext.addReference( adaptingType );
				}

				object obj = RequestParser.readData( reader, parseContext );
				((IDictionary) container)[ str ] = obj;
			}

			if( adaptingType == null )
			{
				container = new object[ arraySize ];
				adaptingType = new ArrayType( (object[]) container );
				parseContext.addReference( adaptingType );

				for( int i = 0; i < arraySize; i++ )
					((object[]) container)[ i ] = RequestParser.readData( reader, parseContext );
			}
			else
			{
				for( int i = 0; i < arraySize; i++ )
				{
					object obj = RequestParser.readData( reader, parseContext );
					((IDictionary) container)[ i.ToString() ] = obj;
				}
			}

			return adaptingType;
		}
		public IAdaptingType read( FlashorbBinaryReader reader, ParseContext parseContext )
		{
			int refId = reader.ReadVarInteger();

			if( (refId & 0x1) == 0 )
				return (ArrayType) parseContext.getReference( refId >> 1 );

			byte[] bytes = reader.ReadBytes( refId >> 1 );
            IAdaptingType[] objArray = new IAdaptingType[bytes.Length];

            for (int i = 0; i < bytes.Length; i++)
                objArray[i] = new NumberObject( bytes[i] );

			ArrayType arrayType = new ArrayType( objArray );
			parseContext.addReference( arrayType );
			return arrayType;
		}
 public ArrayCollectionType( Object[] array, ArrayType arrayType ) : base( array )
 {
   _arrayType = arrayType;
 }