public override void Read(BinaryParser input)
        {
            switch (this._binaryHeaderEnum)
            {
            case BinaryHeaderEnum.ArraySinglePrimitive:
                this.ObjectId             = input.ReadInt32();
                this._lengthA             = new int[] { input.ReadInt32() };
                this._binaryArrayTypeEnum = BinaryArrayTypeEnum.Single;
                this._rank            = 1;
                this._lowerBoundA     = new int[this._rank];
                this._binaryTypeEnum  = BinaryTypeEnum.Primitive;
                this._typeInformation = (PrimitiveTypeEnum)input.ReadByte();
                return;

            case BinaryHeaderEnum.ArraySingleObject:
                this.ObjectId             = input.ReadInt32();
                this._lengthA             = new int[] { input.ReadInt32() };
                this._binaryArrayTypeEnum = BinaryArrayTypeEnum.Single;
                this._rank            = 1;
                this._lowerBoundA     = new int[this._rank];
                this._binaryTypeEnum  = BinaryTypeEnum.Object;
                this._typeInformation = null;
                return;

            case BinaryHeaderEnum.ArraySingleString:
                this.ObjectId             = input.ReadInt32();
                this._lengthA             = new int[] { input.ReadInt32() };
                this._binaryArrayTypeEnum = BinaryArrayTypeEnum.Single;
                this._rank            = 1;
                this._lowerBoundA     = new int[this._rank];
                this._binaryTypeEnum  = BinaryTypeEnum.String;
                this._typeInformation = null;
                return;
            }
            this.ObjectId             = input.ReadInt32();
            this._binaryArrayTypeEnum = (BinaryArrayTypeEnum)input.ReadByte();
            this._rank        = input.ReadInt32();
            this._lengthA     = new int[this._rank];
            this._lowerBoundA = new int[this._rank];
            for (int i = 0; i < this._rank; i++)
            {
                this._lengthA[i] = input.ReadInt32();
            }
            if ((this._binaryArrayTypeEnum == BinaryArrayTypeEnum.SingleOffset) || ((this._binaryArrayTypeEnum == BinaryArrayTypeEnum.JaggedOffset) || (this._binaryArrayTypeEnum == BinaryArrayTypeEnum.RectangularOffset)))
            {
                for (int j = 0; j < this._rank; j++)
                {
                    this._lowerBoundA[j] = input.ReadInt32();
                }
            }
            this._binaryTypeEnum  = (BinaryTypeEnum)input.ReadByte();
            this._typeInformation = BinaryTypeConverter.ReadTypeInfo(this._binaryTypeEnum, input, out this._assemId);
        }
 public override void Read(BinaryParser input)
 {
     this.ObjectId             = input.ReadInt32();
     this.Name                 = input.ReadString();
     this.NumMembers           = input.ReadInt32();
     this.MemberNames          = new string[this.NumMembers];
     this.BinaryTypeEnumArray  = new BinaryTypeEnum[this.NumMembers];
     this.TypeInformationArray = new object[this.NumMembers];
     this.MemberAssemIds       = new int[this.NumMembers];
     for (int i = 0; i < this.NumMembers; i++)
     {
         this.MemberNames[i] = input.ReadString();
     }
     for (int j = 0; j < this.NumMembers; j++)
     {
         this.BinaryTypeEnumArray[j] = (BinaryTypeEnum)input.ReadByte();
     }
     for (int k = 0; k < this.NumMembers; k++)
     {
         if ((this.BinaryTypeEnumArray[k] != BinaryTypeEnum.ObjectUrt) && (this.BinaryTypeEnumArray[k] != BinaryTypeEnum.ObjectUser))
         {
             this.TypeInformationArray[k] = BinaryTypeConverter.ReadTypeInfo(this.BinaryTypeEnumArray[k], input, out this.MemberAssemIds[k]);
         }
         else
         {
             BinaryTypeConverter.ReadTypeInfo(this.BinaryTypeEnumArray[k], input, out this.MemberAssemIds[k]);
         }
     }
     if (this.BinaryHeaderEnum == BinaryHeaderEnum.ObjectWithMapTypedAssemId)
     {
         this.AssemId = input.ReadInt32();
     }
 }
        public static object ReadTypeInfo(BinaryTypeEnum binaryTypeEnum, BinaryParser input, out int assemId)
        {
            object obj2 = null;
            int    num  = 0;

            switch (binaryTypeEnum)
            {
            case BinaryTypeEnum.Primitive:
            case BinaryTypeEnum.PrimitiveArray:
                obj2 = (PrimitiveTypeEnum)input.ReadByte();
                break;

            case BinaryTypeEnum.String:
            case BinaryTypeEnum.Object:
            case BinaryTypeEnum.ObjectArray:
            case BinaryTypeEnum.StringArray:
                break;

            case BinaryTypeEnum.ObjectUrt:
                obj2 = input.ReadString();
                break;

            case BinaryTypeEnum.ObjectUser:
                obj2 = input.ReadString();
                num  = input.ReadInt32();
                break;

            default:
                throw new SerializationException(RemotingResources.SerializationTypeRead.Format(binaryTypeEnum));
            }
            assemId = num;
            return(obj2);
        }
Exemple #4
0
        public void Read(BinaryParser input)
        {
            switch (binaryHeaderEnum)
            {
            case BinaryHeaderEnum.ObjectNull:
                this.NullCount = 1;
                return;

            case BinaryHeaderEnum.MessageEnd:
            case BinaryHeaderEnum.Assembly:
                break;

            case BinaryHeaderEnum.ObjectNullMultiple256:
                this.NullCount = input.ReadByte();
                return;

            case BinaryHeaderEnum.ObjectNullMultiple:
                this.NullCount = input.ReadInt32();
                break;

            default:
                return;
            }
        }
Exemple #5
0
 public void Read(BinaryParser input)
 {
     this.PrimitiveTypeEnum = (PrimitiveTypeEnum)input.ReadByte();
     this.Value             = input.ReadValue(this.PrimitiveTypeEnum);
 }