internal void WriteRectangleArray(NameInfo memberNameInfo, NameInfo arrayNameInfo, WriteObjectInfo objectInfo, NameInfo arrayElemTypeNameInfo, int rank, int[] lengthA, int[] lowerBoundA)
        {
            InternalWriteItemNull();

            BinaryArrayTypeEnum binaryArrayTypeEnum = BinaryArrayTypeEnum.Rectangular;
            object         typeInformation          = null;
            int            assemId        = 0;
            BinaryTypeEnum binaryTypeEnum = BinaryTypeConverter.GetBinaryTypeInfo(arrayElemTypeNameInfo._type, objectInfo, arrayElemTypeNameInfo.NIname, _objectWriter, out typeInformation, out assemId);

            if (_binaryArray == null)
            {
                _binaryArray = new BinaryArray();
            }

            for (int i = 0; i < rank; i++)
            {
                if (lowerBoundA[i] != 0)
                {
                    binaryArrayTypeEnum = BinaryArrayTypeEnum.RectangularOffset;
                    break;
                }
            }

            _binaryArray.Set((int)arrayNameInfo._objectId, rank, lengthA, lowerBoundA, binaryTypeEnum, typeInformation, binaryArrayTypeEnum, assemId);
            _binaryArray.Write(this);
        }
        internal void WriteRectangleArray(NameInfo memberNameInfo, NameInfo arrayNameInfo, WriteObjectInfo objectInfo, NameInfo arrayElemTypeNameInfo, int rank, int[] lengthA, int[] lowerBoundA)
        {
            arrayNameInfo.Dump("WriteRectangleArray arrayNameInfo");
            arrayElemTypeNameInfo.Dump("WriteRectangleArray arrayElemTypeNameInfo");
            InternalWriteItemNull();

            BinaryArrayTypeEnum binaryArrayTypeEnum = BinaryArrayTypeEnum.Rectangular;
            Object         typeInformation          = null;
            int            assemId        = 0;
            BinaryTypeEnum binaryTypeEnum = BinaryConverter.GetBinaryTypeInfo(arrayElemTypeNameInfo.NItype, objectInfo, arrayElemTypeNameInfo.NIname, objectWriter, out typeInformation, out assemId);

            if (binaryArray == null)
            {
                binaryArray = new BinaryArray();
            }

            for (int i = 0; i < rank; i++)
            {
                if (lowerBoundA[i] != 0)
                {
                    binaryArrayTypeEnum = BinaryArrayTypeEnum.RectangularOffset;
                    break;
                }
            }

            binaryArray.Set((int)arrayNameInfo.NIobjectId, rank, lengthA, lowerBoundA, binaryTypeEnum, typeInformation, binaryArrayTypeEnum, assemId);

            if (arrayNameInfo.NIobjectId > 0)
            {
                BCLDebug.Trace("BINARY", "-----Top Level Object-----");
            }
            binaryArray.Dump();

            binaryArray.Write(this);
        }
 internal void Set(int objectId, int rank, int[] lengthA, int[] lowerBoundA, BinaryTypeEnum binaryTypeEnum, object typeInformation, BinaryArrayTypeEnum binaryArrayTypeEnum, int assemId)
 {
     this.objectId = objectId;
     this.binaryArrayTypeEnum = binaryArrayTypeEnum;
     this.rank = rank;
     this.lengthA = lengthA;
     this.lowerBoundA = lowerBoundA;
     this.binaryTypeEnum = binaryTypeEnum;
     this.typeInformation = typeInformation;
     this.assemId = assemId;
     this.binaryHeaderEnum = BinaryHeaderEnum.Array;
     if (binaryArrayTypeEnum == BinaryArrayTypeEnum.Single)
     {
         if (binaryTypeEnum == BinaryTypeEnum.Primitive)
         {
             this.binaryHeaderEnum = BinaryHeaderEnum.ArraySinglePrimitive;
         }
         else if (binaryTypeEnum == BinaryTypeEnum.String)
         {
             this.binaryHeaderEnum = BinaryHeaderEnum.ArraySingleString;
         }
         else if (binaryTypeEnum == BinaryTypeEnum.Object)
         {
             this.binaryHeaderEnum = BinaryHeaderEnum.ArraySingleObject;
         }
     }
 }
Exemple #4
0
 internal void Set(int objectId, int rank, int[] lengthA, int[] lowerBoundA, BinaryTypeEnum binaryTypeEnum, object typeInformation, BinaryArrayTypeEnum binaryArrayTypeEnum, int assemId)
 {
     this.objectId            = objectId;
     this.binaryArrayTypeEnum = binaryArrayTypeEnum;
     this.rank             = rank;
     this.lengthA          = lengthA;
     this.lowerBoundA      = lowerBoundA;
     this.binaryTypeEnum   = binaryTypeEnum;
     this.typeInformation  = typeInformation;
     this.assemId          = assemId;
     this.binaryHeaderEnum = BinaryHeaderEnum.Array;
     if (binaryArrayTypeEnum != BinaryArrayTypeEnum.Single)
     {
         return;
     }
     if (binaryTypeEnum == BinaryTypeEnum.Primitive)
     {
         this.binaryHeaderEnum = BinaryHeaderEnum.ArraySinglePrimitive;
     }
     else if (binaryTypeEnum == BinaryTypeEnum.String)
     {
         this.binaryHeaderEnum = BinaryHeaderEnum.ArraySingleString;
     }
     else
     {
         if (binaryTypeEnum != BinaryTypeEnum.Object)
         {
             return;
         }
         this.binaryHeaderEnum = BinaryHeaderEnum.ArraySingleObject;
     }
 }
Exemple #5
0
        internal void Set(int objectId, int rank, int[] lengthA, int[]?lowerBoundA, BinaryTypeEnum binaryTypeEnum, object?typeInformation, BinaryArrayTypeEnum binaryArrayTypeEnum, int assemId)
        {
            _objectId            = objectId;
            _binaryArrayTypeEnum = binaryArrayTypeEnum;
            _rank            = rank;
            _lengthA         = lengthA;
            _lowerBoundA     = lowerBoundA;
            _binaryTypeEnum  = binaryTypeEnum;
            _typeInformation = typeInformation;
            _assemId         = assemId;

            _binaryHeaderEnum = BinaryHeaderEnum.Array;
            if (binaryArrayTypeEnum == BinaryArrayTypeEnum.Single)
            {
                if (binaryTypeEnum == BinaryTypeEnum.Primitive)
                {
                    _binaryHeaderEnum = BinaryHeaderEnum.ArraySinglePrimitive;
                }
                else if (binaryTypeEnum == BinaryTypeEnum.String)
                {
                    _binaryHeaderEnum = BinaryHeaderEnum.ArraySingleString;
                }
                else if (binaryTypeEnum == BinaryTypeEnum.Object)
                {
                    _binaryHeaderEnum = BinaryHeaderEnum.ArraySingleObject;
                }
            }
        }
        internal void WriteRectangleArray(NameInfo memberNameInfo, NameInfo arrayNameInfo, WriteObjectInfo objectInfo, NameInfo arrayElemTypeNameInfo, int rank, int[] lengthA, int[] lowerBoundA)
        {
            this.InternalWriteItemNull();
            BinaryArrayTypeEnum binaryArrayTypeEnum = BinaryArrayTypeEnum.Rectangular;
            object         typeInformation          = (object)null;
            int            assemId        = 0;
            BinaryTypeEnum binaryTypeInfo = BinaryConverter.GetBinaryTypeInfo(arrayElemTypeNameInfo.NItype, objectInfo, arrayElemTypeNameInfo.NIname, this.objectWriter, out typeInformation, out assemId);

            if (this.binaryArray == null)
            {
                this.binaryArray = new BinaryArray();
            }
            for (int index = 0; index < rank; ++index)
            {
                if (lowerBoundA[index] != 0)
                {
                    binaryArrayTypeEnum = BinaryArrayTypeEnum.RectangularOffset;
                    break;
                }
            }
            this.binaryArray.Set((int)arrayNameInfo.NIobjectId, rank, lengthA, lowerBoundA, binaryTypeInfo, typeInformation, binaryArrayTypeEnum, assemId);
            long num = arrayNameInfo.NIobjectId;

            this.binaryArray.Write(this);
        }
Exemple #7
0
        internal void WriteRectangleArray(/*NameInfo memberNameInfo,*/ NameInfo arrayNameInfo, WriteObjectInfo objectInfo, NameInfo arrayElemTypeNameInfo, int rank, int[] lengthA, int[] lowerBoundA)
        {
            this.InternalWriteItemNull();
            BinaryArrayTypeEnum rectangular    = BinaryArrayTypeEnum.Rectangular;
            BinaryTypeEnum      binaryTypeEnum = BinaryTypeConverter.GetBinaryTypeInfo(arrayElemTypeNameInfo._type, objectInfo, this._objectWriter, out object typeInformation, out int assemId);

            if (this._binaryArray == null)
            {
                this._binaryArray = new BinaryArray();
            }
            int index = 0;

            while (true)
            {
                if (index < rank)
                {
                    if (lowerBoundA[index] == 0)
                    {
                        index++;
                        continue;
                    }
                    rectangular = BinaryArrayTypeEnum.RectangularOffset;
                }
                this._binaryArray.Set((int)arrayNameInfo._objectId, rank, lengthA, lowerBoundA, binaryTypeEnum, typeInformation, rectangular, assemId);
                this._binaryArray.Write(this);
                return;
            }
        }
Exemple #8
0
        public void Read(__BinaryParser input)
        {
            switch (this.binaryHeaderEnum)
            {
            case BinaryHeaderEnum.ArraySinglePrimitive:
                this.objectId            = input.ReadInt32();
                this.lengthA             = new int[1];
                this.lengthA[0]          = input.ReadInt32();
                this.binaryArrayTypeEnum = BinaryArrayTypeEnum.Single;
                this.rank            = 1;
                this.lowerBoundA     = new int[this.rank];
                this.binaryTypeEnum  = BinaryTypeEnum.Primitive;
                this.typeInformation = (object)(InternalPrimitiveTypeE)input.ReadByte();
                break;

            case BinaryHeaderEnum.ArraySingleObject:
                this.objectId            = input.ReadInt32();
                this.lengthA             = new int[1];
                this.lengthA[0]          = input.ReadInt32();
                this.binaryArrayTypeEnum = BinaryArrayTypeEnum.Single;
                this.rank            = 1;
                this.lowerBoundA     = new int[this.rank];
                this.binaryTypeEnum  = BinaryTypeEnum.Object;
                this.typeInformation = (object)null;
                break;

            case BinaryHeaderEnum.ArraySingleString:
                this.objectId            = input.ReadInt32();
                this.lengthA             = new int[1];
                this.lengthA[0]          = input.ReadInt32();
                this.binaryArrayTypeEnum = BinaryArrayTypeEnum.Single;
                this.rank            = 1;
                this.lowerBoundA     = new int[this.rank];
                this.binaryTypeEnum  = BinaryTypeEnum.String;
                this.typeInformation = (object)null;
                break;

            default:
                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 index = 0; index < this.rank; ++index)
                {
                    this.lengthA[index] = input.ReadInt32();
                }
                if (this.binaryArrayTypeEnum == BinaryArrayTypeEnum.SingleOffset || this.binaryArrayTypeEnum == BinaryArrayTypeEnum.JaggedOffset || this.binaryArrayTypeEnum == BinaryArrayTypeEnum.RectangularOffset)
                {
                    for (int index = 0; index < this.rank; ++index)
                    {
                        this.lowerBoundA[index] = input.ReadInt32();
                    }
                }
                this.binaryTypeEnum  = (BinaryTypeEnum)input.ReadByte();
                this.typeInformation = BinaryConverter.ReadTypeInfo(this.binaryTypeEnum, input, out this.assemId);
                break;
            }
        }
        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 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 = (InternalPrimitiveTypeE) 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 = BinaryConverter.ReadTypeInfo(this.binaryTypeEnum, input, out this.assemId);
        }
Exemple #11
0
        public void Read(BinaryParser input)
        {
            switch (_binaryHeaderEnum)
            {
            case BinaryHeaderEnum.ArraySinglePrimitive:
                _objectId            = input.ReadInt32();
                _lengthA             = new int[1];
                _lengthA[0]          = input.ReadInt32();
                _binaryArrayTypeEnum = BinaryArrayTypeEnum.Single;
                _rank            = 1;
                _lowerBoundA     = new int[_rank];
                _binaryTypeEnum  = BinaryTypeEnum.Primitive;
                _typeInformation = (InternalPrimitiveTypeE)input.ReadByte();
                break;

            case BinaryHeaderEnum.ArraySingleString:
                _objectId            = input.ReadInt32();
                _lengthA             = new int[1];
                _lengthA[0]          = input.ReadInt32();
                _binaryArrayTypeEnum = BinaryArrayTypeEnum.Single;
                _rank            = 1;
                _lowerBoundA     = new int[_rank];
                _binaryTypeEnum  = BinaryTypeEnum.String;
                _typeInformation = null;
                break;

            case BinaryHeaderEnum.ArraySingleObject:
                _objectId            = input.ReadInt32();
                _lengthA             = new int[1];
                _lengthA[0]          = input.ReadInt32();
                _binaryArrayTypeEnum = BinaryArrayTypeEnum.Single;
                _rank            = 1;
                _lowerBoundA     = new int[_rank];
                _binaryTypeEnum  = BinaryTypeEnum.Object;
                _typeInformation = null;
                break;

            default:
                _objectId            = input.ReadInt32();
                _binaryArrayTypeEnum = (BinaryArrayTypeEnum)input.ReadByte();
                _rank        = input.ReadInt32();
                _lengthA     = new int[_rank];
                _lowerBoundA = new int[_rank];
                for (int i = 0; i < _rank; i++)
                {
                    _lengthA[i] = input.ReadInt32();
                }
                if ((_binaryArrayTypeEnum == BinaryArrayTypeEnum.SingleOffset) ||
                    (_binaryArrayTypeEnum == BinaryArrayTypeEnum.JaggedOffset) ||
                    (_binaryArrayTypeEnum == BinaryArrayTypeEnum.RectangularOffset))
                {
                    for (int i = 0; i < _rank; i++)
                    {
                        _lowerBoundA[i] = input.ReadInt32();
                    }
                }
                _binaryTypeEnum  = (BinaryTypeEnum)input.ReadByte();
                _typeInformation = BinaryTypeConverter.ReadTypeInfo(_binaryTypeEnum, input, out _assemId);
                break;
            }
        }
 [System.Security.SecurityCritical] // implements Critical method
 public void Read(__BinaryParser input)
 {
     switch (binaryHeaderEnum) 
     {
         case BinaryHeaderEnum.ArraySinglePrimitive: 
             objectId = input.ReadInt32(); 
             lengthA = new int[1];
             lengthA[0] = input.ReadInt32(); 
             binaryArrayTypeEnum = BinaryArrayTypeEnum.Single;
             rank = 1;
             lowerBoundA = new Int32[rank];
             binaryTypeEnum = BinaryTypeEnum.Primitive; 
             typeInformation = (InternalPrimitiveTypeE)input.ReadByte();
             break; 
         case BinaryHeaderEnum.ArraySingleString: 
             objectId = input.ReadInt32();
             lengthA = new int[1]; 
             lengthA[0] = (int)input.ReadInt32();
             binaryArrayTypeEnum = BinaryArrayTypeEnum.Single;
             rank = 1;
             lowerBoundA = new Int32[rank]; 
             binaryTypeEnum = BinaryTypeEnum.String;
             typeInformation = null; 
             break; 
         case BinaryHeaderEnum.ArraySingleObject:
             objectId = input.ReadInt32(); 
             lengthA = new int[1];
             lengthA[0] = (int)input.ReadInt32();
             binaryArrayTypeEnum = BinaryArrayTypeEnum.Single;
             rank = 1; 
             lowerBoundA = new Int32[rank];
             binaryTypeEnum = BinaryTypeEnum.Object; 
             typeInformation = null; 
             break;
 default: 
             objectId = input.ReadInt32();
             binaryArrayTypeEnum = (BinaryArrayTypeEnum)input.ReadByte();
             rank = input.ReadInt32();
             lengthA = new Int32[rank]; 
             lowerBoundA = new Int32[rank];
             for (int i=0; i<rank; i++) 
                 lengthA[i] = input.ReadInt32(); 
             if ((binaryArrayTypeEnum == BinaryArrayTypeEnum.SingleOffset) ||
                 (binaryArrayTypeEnum == BinaryArrayTypeEnum.JaggedOffset) || 
                 (binaryArrayTypeEnum == BinaryArrayTypeEnum.RectangularOffset))
             {
                 for (int i=0; i<rank; i++)
                     lowerBoundA[i] = input.ReadInt32(); 
             }
             binaryTypeEnum = (BinaryTypeEnum)input.ReadByte(); 
             typeInformation = BinaryConverter.ReadTypeInfo(binaryTypeEnum, input, out assemId); 
             break;
     } 
 }
        internal void Set(Int32 objectId, Int32 rank, Int32[] lengthA, Int32[] lowerBoundA, BinaryTypeEnum binaryTypeEnum, Object typeInformation, BinaryArrayTypeEnum binaryArrayTypeEnum, int assemId)
        { 
            SerTrace.Log( this, "BinaryArray Set objectId ",objectId," rank ",rank," ",((Enum)binaryTypeEnum).ToString(),", assemId ",assemId); 
            this.objectId = objectId;
            this.binaryArrayTypeEnum = binaryArrayTypeEnum; 
            this.rank = rank;
            this.lengthA = lengthA;
            this.lowerBoundA = lowerBoundA;
            this.binaryTypeEnum = binaryTypeEnum; 
            this.typeInformation = typeInformation;
            this.assemId = assemId; 
            binaryHeaderEnum = BinaryHeaderEnum.Array; 

            if (binaryArrayTypeEnum == BinaryArrayTypeEnum.Single) 
            {
                if (binaryTypeEnum == BinaryTypeEnum.Primitive)
                    binaryHeaderEnum = BinaryHeaderEnum.ArraySinglePrimitive;
                else if (binaryTypeEnum == BinaryTypeEnum.String) 
                    binaryHeaderEnum = BinaryHeaderEnum.ArraySingleString;
                else if (binaryTypeEnum == BinaryTypeEnum.Object) 
                    binaryHeaderEnum = BinaryHeaderEnum.ArraySingleObject; 
            }
            SerTrace.Log( this, "BinaryArray Set Exit ",((Enum)binaryHeaderEnum).ToString()); 
        }
Exemple #14
0
        public void Read(BinaryReader input)
        {
            switch (binaryHeaderEnum)
            {
            case BinaryHeaderEnum.ArraySinglePrimitive:
                objectId            = input.ReadInt32();
                lengthA             = new int[1];
                lengthA[0]          = input.ReadInt32();
                binaryArrayTypeEnum = BinaryArrayTypeEnum.Single;
                rank            = 1;
                lowerBoundA     = new Int32[rank];
                binaryTypeEnum  = BinaryTypeEnum.Primitive;
                typeInformation = (InternalPrimitiveTypeE)input.ReadByte();
                break;

            case BinaryHeaderEnum.ArraySingleString:
                objectId            = input.ReadInt32();
                lengthA             = new int[1];
                lengthA[0]          = (int)input.ReadInt32();
                binaryArrayTypeEnum = BinaryArrayTypeEnum.Single;
                rank            = 1;
                lowerBoundA     = new Int32[rank];
                binaryTypeEnum  = BinaryTypeEnum.String;
                typeInformation = null;
                break;

            case BinaryHeaderEnum.ArraySingleObject:
                objectId            = input.ReadInt32();
                lengthA             = new int[1];
                lengthA[0]          = (int)input.ReadInt32();
                binaryArrayTypeEnum = BinaryArrayTypeEnum.Single;
                rank            = 1;
                lowerBoundA     = new Int32[rank];
                binaryTypeEnum  = BinaryTypeEnum.Object;
                typeInformation = null;
                break;

            default:
                objectId            = input.ReadInt32();
                binaryArrayTypeEnum = (BinaryArrayTypeEnum)input.ReadByte();
                rank        = input.ReadInt32();
                lengthA     = new Int32[rank];
                lowerBoundA = new Int32[rank];
                for (int i = 0; i < rank; i++)
                {
                    lengthA[i] = input.ReadInt32();
                }
                if ((binaryArrayTypeEnum == BinaryArrayTypeEnum.SingleOffset) ||
                    (binaryArrayTypeEnum == BinaryArrayTypeEnum.JaggedOffset) ||
                    (binaryArrayTypeEnum == BinaryArrayTypeEnum.RectangularOffset))
                {
                    for (int i = 0; i < rank; i++)
                    {
                        lowerBoundA[i] = input.ReadInt32();
                    }
                }
                binaryTypeEnum  = (BinaryTypeEnum)input.ReadByte();
                typeInformation = BinaryConverter.ReadTypeInfo(binaryTypeEnum, input, out assemId);
                break;
            }
        }
Exemple #15
0
 public void Read(BinaryParser input)
 {
     switch (_binaryHeaderEnum)
     {
         case BinaryHeaderEnum.ArraySinglePrimitive:
             _objectId = input.ReadInt32();
             _lengthA = new int[1];
             _lengthA[0] = input.ReadInt32();
             _binaryArrayTypeEnum = BinaryArrayTypeEnum.Single;
             _rank = 1;
             _lowerBoundA = new int[_rank];
             _binaryTypeEnum = BinaryTypeEnum.Primitive;
             _typeInformation = (InternalPrimitiveTypeE)input.ReadByte();
             break;
         case BinaryHeaderEnum.ArraySingleString:
             _objectId = input.ReadInt32();
             _lengthA = new int[1];
             _lengthA[0] = input.ReadInt32();
             _binaryArrayTypeEnum = BinaryArrayTypeEnum.Single;
             _rank = 1;
             _lowerBoundA = new int[_rank];
             _binaryTypeEnum = BinaryTypeEnum.String;
             _typeInformation = null;
             break;
         case BinaryHeaderEnum.ArraySingleObject:
             _objectId = input.ReadInt32();
             _lengthA = new int[1];
             _lengthA[0] = input.ReadInt32();
             _binaryArrayTypeEnum = BinaryArrayTypeEnum.Single;
             _rank = 1;
             _lowerBoundA = new int[_rank];
             _binaryTypeEnum = BinaryTypeEnum.Object;
             _typeInformation = null;
             break;
         default:
             _objectId = input.ReadInt32();
             _binaryArrayTypeEnum = (BinaryArrayTypeEnum)input.ReadByte();
             _rank = input.ReadInt32();
             _lengthA = new int[_rank];
             _lowerBoundA = new int[_rank];
             for (int i = 0; i < _rank; i++)
             {
                 _lengthA[i] = input.ReadInt32();
             }
             if ((_binaryArrayTypeEnum == BinaryArrayTypeEnum.SingleOffset) ||
                 (_binaryArrayTypeEnum == BinaryArrayTypeEnum.JaggedOffset) ||
                 (_binaryArrayTypeEnum == BinaryArrayTypeEnum.RectangularOffset))
             {
                 for (int i = 0; i < _rank; i++)
                 {
                     _lowerBoundA[i] = input.ReadInt32();
                 }
             }
             _binaryTypeEnum = (BinaryTypeEnum)input.ReadByte();
             _typeInformation = BinaryTypeConverter.ReadTypeInfo(_binaryTypeEnum, input, out _assemId);
             break;
     }
 }