상속: IStreamable
예제 #1
0
        [System.Security.SecurityCritical]  // auto-generated
        private void ReadArray(BinaryHeaderEnum binaryHeaderEnum)
        {
            BinaryAssemblyInfo assemblyInfo = null;
            SerTrace.Log( this, "ReadArray ");
            BinaryArray record = new BinaryArray(binaryHeaderEnum);
            record.Read(this);
#if _DEBUG                        
            record.Dump();

            SerTrace.Log( this, "Read 1 ",((Enum)binaryHeaderEnum).ToString());
#endif
            if (record.binaryTypeEnum == BinaryTypeEnum.ObjectUser)
            {
                if (record.assemId < 1)
                    throw new SerializationException(Environment.GetResourceString("Serialization_AssemblyId",record.typeInformation));

                assemblyInfo = (BinaryAssemblyInfo)AssemIdToAssemblyTable[record.assemId];
                SerTrace.Log( this, "ReadArray  lookup assemIdToAssembly assemId ",record.assemId," assembly ",assemblyInfo.assemblyString);                                
            }
            else
                assemblyInfo = SystemAssemblyInfo; //Urt assembly

            ObjectProgress op = GetOp();
            ParseRecord pr = op.pr;

            op.objectTypeEnum = InternalObjectTypeE.Array;
            op.binaryTypeEnum = record.binaryTypeEnum;
            op.typeInformation = record.typeInformation;

            ObjectProgress objectOp = (ObjectProgress)stack.PeekPeek();
            if ((objectOp == null) || (record.objectId > 0))
            {
                // Non-Nested Object
                op.name = "System.Array";
                pr.PRparseTypeEnum = InternalParseTypeE.Object;
                op.memberValueEnum = InternalMemberValueE.Empty;                                    
            }
            else
            {
                // Nested Object            
                pr.PRparseTypeEnum = InternalParseTypeE.Member;
                pr.PRmemberValueEnum = InternalMemberValueE.Nested;
                op.memberValueEnum = InternalMemberValueE.Nested;                       

                switch (objectOp.objectTypeEnum)
                {
                case InternalObjectTypeE.Object:
                    pr.PRname = objectOp.name;                                  
                    pr.PRmemberTypeEnum = InternalMemberTypeE.Field;
                    op.memberTypeEnum = InternalMemberTypeE.Field;                  
                    pr.PRkeyDt = objectOp.name;
                    pr.PRdtType = objectOp.dtType;
                    break;
                case InternalObjectTypeE.Array:
                    pr.PRmemberTypeEnum = InternalMemberTypeE.Item;
                    op.memberTypeEnum = InternalMemberTypeE.Item;                   
                    break;
                default:
                    throw new SerializationException(Environment.GetResourceString("Serialization_ObjectTypeEnum",((Enum)objectOp.objectTypeEnum).ToString()));                                              
                }
            }


            pr.PRobjectId = objectReader.GetId((long)record.objectId);
            if (pr.PRobjectId == topId)
                pr.PRobjectPositionEnum = InternalObjectPositionE.Top;
            else if ((headerId > 0) &&(pr.PRobjectId == headerId))
                pr.PRobjectPositionEnum = InternalObjectPositionE.Headers; // Headers are an array of header objects
            else
                pr.PRobjectPositionEnum    = InternalObjectPositionE.Child;

            pr.PRobjectTypeEnum = InternalObjectTypeE.Array;

            BinaryConverter.TypeFromInfo(record.binaryTypeEnum, record.typeInformation, objectReader, assemblyInfo,
                                         out pr.PRarrayElementTypeCode, out pr.PRarrayElementTypeString,
                                         out pr.PRarrayElementType, out pr.PRisArrayVariant);

            pr.PRdtTypeCode = InternalPrimitiveTypeE.Invalid;


            pr.PRrank = record.rank;
            pr.PRlengthA = record.lengthA;
            pr.PRlowerBoundA = record.lowerBoundA;
            bool isPrimitiveArray = false;

            switch (record.binaryArrayTypeEnum)
            {
            case BinaryArrayTypeEnum.Single:
            case BinaryArrayTypeEnum.SingleOffset:                  
                op.numItems = record.lengthA[0];
                pr.PRarrayTypeEnum = InternalArrayTypeE.Single;
                if (Converter.IsWriteAsByteArray(pr.PRarrayElementTypeCode) &&
                    (record.lowerBoundA[0] == 0))
                {
                    isPrimitiveArray = true;
                    ReadArrayAsBytes(pr);
                }
                break;
            case BinaryArrayTypeEnum.Jagged:
            case BinaryArrayTypeEnum.JaggedOffset:                  
                op.numItems = record.lengthA[0];
                pr.PRarrayTypeEnum = InternalArrayTypeE.Jagged;                 
                break;
            case BinaryArrayTypeEnum.Rectangular:
            case BinaryArrayTypeEnum.RectangularOffset:                 
                int arrayLength = 1;
                for (int i=0; i<record.rank; i++)
                    arrayLength = arrayLength*record.lengthA[i];
                op.numItems = arrayLength;
                pr.PRarrayTypeEnum = InternalArrayTypeE.Rectangular;                                        
                break;
            default:
                throw new SerializationException(Environment.GetResourceString("Serialization_ArrayType",((Enum)record.binaryArrayTypeEnum).ToString()));
            }

            if (!isPrimitiveArray)
                stack.Push(op);
            else
            {
                PutOp(op);
            }

            SerTrace.Log( this, "ReadArray ",((Enum)record.binaryArrayTypeEnum).ToString()," length ",op.numItems);             
            objectReader.Parse(pr);

            if (isPrimitiveArray)
            {
                pr.PRparseTypeEnum = InternalParseTypeE.ObjectEnd;
                objectReader.Parse(pr);
            }
        }
예제 #2
0
        private void ReadArray(BinaryHeaderEnum binaryHeaderEnum)
        {
            BinaryAssemblyInfo assemblyInfo = null;
            BinaryArray record = new BinaryArray(binaryHeaderEnum);
            record.Read(this);

            if (record._binaryTypeEnum == BinaryTypeEnum.ObjectUser)
            {
                if (record._assemId < 1)
                {
                    throw new SerializationException(SR.Format(SR.Serialization_AssemblyId, record._typeInformation));
                }
                assemblyInfo = (BinaryAssemblyInfo)AssemIdToAssemblyTable[record._assemId];
            }
            else
            {
                assemblyInfo = SystemAssemblyInfo; //Urt assembly
            }

            ObjectProgress op = GetOp();
            ParseRecord pr = op._pr;

            op._objectTypeEnum = InternalObjectTypeE.Array;
            op._binaryTypeEnum = record._binaryTypeEnum;
            op._typeInformation = record._typeInformation;

            ObjectProgress objectOp = (ObjectProgress)_stack.PeekPeek();
            if ((objectOp == null) || (record._objectId > 0))
            {
                // Non-Nested Object
                op._name = "System.Array";
                pr._parseTypeEnum = InternalParseTypeE.Object;
                op._memberValueEnum = InternalMemberValueE.Empty;
            }
            else
            {
                // Nested Object            
                pr._parseTypeEnum = InternalParseTypeE.Member;
                pr._memberValueEnum = InternalMemberValueE.Nested;
                op._memberValueEnum = InternalMemberValueE.Nested;

                switch (objectOp._objectTypeEnum)
                {
                    case InternalObjectTypeE.Object:
                        pr._name = objectOp._name;
                        pr._memberTypeEnum = InternalMemberTypeE.Field;
                        op._memberTypeEnum = InternalMemberTypeE.Field;
                        pr._keyDt = objectOp._name;
                        pr._dtType = objectOp._dtType;
                        break;
                    case InternalObjectTypeE.Array:
                        pr._memberTypeEnum = InternalMemberTypeE.Item;
                        op._memberTypeEnum = InternalMemberTypeE.Item;
                        break;
                    default:
                        throw new SerializationException(SR.Format(SR.Serialization_ObjectTypeEnum, objectOp._objectTypeEnum.ToString()));
                }
            }

            pr._objectId = _objectReader.GetId(record._objectId);
            if (pr._objectId == _topId)
            {
                pr._objectPositionEnum = InternalObjectPositionE.Top;
            }
            else if ((_headerId > 0) && (pr._objectId == _headerId))
            {
                pr._objectPositionEnum = InternalObjectPositionE.Headers; // Headers are an array of header objects
            }
            else
            {
                pr._objectPositionEnum = InternalObjectPositionE.Child;
            }

            pr._objectTypeEnum = InternalObjectTypeE.Array;

            BinaryTypeConverter.TypeFromInfo(record._binaryTypeEnum, record._typeInformation, _objectReader, assemblyInfo,
                                         out pr._arrayElementTypeCode, out pr._arrayElementTypeString,
                                         out pr._arrayElementType, out pr._isArrayVariant);

            pr._dtTypeCode = InternalPrimitiveTypeE.Invalid;

            pr._rank = record._rank;
            pr._lengthA = record._lengthA;
            pr._lowerBoundA = record._lowerBoundA;
            bool isPrimitiveArray = false;

            switch (record._binaryArrayTypeEnum)
            {
                case BinaryArrayTypeEnum.Single:
                case BinaryArrayTypeEnum.SingleOffset:
                    op._numItems = record._lengthA[0];
                    pr._arrayTypeEnum = InternalArrayTypeE.Single;
                    if (Converter.IsWriteAsByteArray(pr._arrayElementTypeCode) &&
                        (record._lowerBoundA[0] == 0))
                    {
                        isPrimitiveArray = true;
                        ReadArrayAsBytes(pr);
                    }
                    break;
                case BinaryArrayTypeEnum.Jagged:
                case BinaryArrayTypeEnum.JaggedOffset:
                    op._numItems = record._lengthA[0];
                    pr._arrayTypeEnum = InternalArrayTypeE.Jagged;
                    break;
                case BinaryArrayTypeEnum.Rectangular:
                case BinaryArrayTypeEnum.RectangularOffset:
                    int arrayLength = 1;
                    for (int i = 0; i < record._rank; i++)
                        arrayLength = arrayLength * record._lengthA[i];
                    op._numItems = arrayLength;
                    pr._arrayTypeEnum = InternalArrayTypeE.Rectangular;
                    break;
                default:
                    throw new SerializationException(SR.Format(SR.Serialization_ArrayType, record._binaryArrayTypeEnum.ToString()));
            }

            if (!isPrimitiveArray)
            {
                _stack.Push(op);
            }
            else
            {
                PutOp(op);
            }

            _objectReader.Parse(pr);

            if (isPrimitiveArray)
            {
                pr._parseTypeEnum = InternalParseTypeE.ObjectEnd;
                _objectReader.Parse(pr);
            }
        }
예제 #3
0
        internal void WriteJaggedArray(NameInfo memberNameInfo, NameInfo arrayNameInfo, WriteObjectInfo objectInfo, NameInfo arrayElemTypeNameInfo, int length, int lowerBound) 
        {
#if _DEBUG 
            arrayNameInfo.Dump("WriteRectangleArray arrayNameInfo"); 
            arrayElemTypeNameInfo.Dump("WriteRectangleArray arrayElemTypeNameInfo");
#endif 
            InternalWriteItemNull();
            BinaryArrayTypeEnum binaryArrayTypeEnum;
            Int32[] lengthA = new Int32[1];
            lengthA[0] = length; 
            Int32[] lowerBoundA = null;
            Object typeInformation = null; 
            int assemId = 0; 

            if (lowerBound == 0) 
            {
                binaryArrayTypeEnum = BinaryArrayTypeEnum.Jagged;
            }
            else 
            {
                binaryArrayTypeEnum = BinaryArrayTypeEnum.JaggedOffset; 
                lowerBoundA = new Int32[1]; 
                lowerBoundA[0] = lowerBound;
            } 

            BinaryTypeEnum binaryTypeEnum = BinaryConverter.GetBinaryTypeInfo(arrayElemTypeNameInfo.NItype, objectInfo, arrayElemTypeNameInfo.NIname, objectWriter, out typeInformation, out assemId);

            if (binaryArray == null) 
                binaryArray = new BinaryArray();
            binaryArray.Set((int)arrayNameInfo.NIobjectId, (int)1, lengthA, lowerBoundA, binaryTypeEnum, typeInformation, binaryArrayTypeEnum, assemId); 
 
            if (arrayNameInfo.NIobjectId >0)
            { 
                BCLDebug.Trace("BINARY", "-----Top Level Object-----");
            }
#if _DEBUG
            binaryArray.Dump(); 
#endif
            binaryArray.Write(this); 
        } 
예제 #4
0
        internal void WriteRectangleArray(NameInfo memberNameInfo, NameInfo arrayNameInfo, WriteObjectInfo objectInfo, NameInfo arrayElemTypeNameInfo, int rank, int[] lengthA, int[] lowerBoundA) 
        {
#if _DEBUG
            arrayNameInfo.Dump("WriteRectangleArray arrayNameInfo");
            arrayElemTypeNameInfo.Dump("WriteRectangleArray arrayElemTypeNameInfo"); 
#endif
            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-----");
            } 
#if _DEBUG
            binaryArray.Dump(); 
#endif 
            binaryArray.Write(this);
        } 
 internal void WriteSingleArray(NameInfo memberNameInfo, NameInfo arrayNameInfo, WriteObjectInfo objectInfo, NameInfo arrayElemTypeNameInfo, int length, int lowerBound, Array array)
 {
     BinaryArrayTypeEnum single;
     int num;
     this.InternalWriteItemNull();
     int[] lengthA = new int[] { length };
     int[] lowerBoundA = null;
     object typeInformation = null;
     if (lowerBound == 0)
     {
         single = BinaryArrayTypeEnum.Single;
     }
     else
     {
         single = BinaryArrayTypeEnum.SingleOffset;
         lowerBoundA = new int[] { lowerBound };
     }
     BinaryTypeEnum binaryTypeEnum = BinaryConverter.GetBinaryTypeInfo(arrayElemTypeNameInfo.NItype, objectInfo, arrayElemTypeNameInfo.NIname, this.objectWriter, out typeInformation, out num);
     if (this.binaryArray == null)
     {
         this.binaryArray = new BinaryArray();
     }
     this.binaryArray.Set((int) arrayNameInfo.NIobjectId, 1, lengthA, lowerBoundA, binaryTypeEnum, typeInformation, single, num);
     long nIobjectId = arrayNameInfo.NIobjectId;
     this.binaryArray.Write(this);
     if (Converter.IsWriteAsByteArray(arrayElemTypeNameInfo.NIprimitiveTypeEnum) && (lowerBound == 0))
     {
         if (arrayElemTypeNameInfo.NIprimitiveTypeEnum == InternalPrimitiveTypeE.Byte)
         {
             this.WriteBytes((byte[]) array);
         }
         else if (arrayElemTypeNameInfo.NIprimitiveTypeEnum == InternalPrimitiveTypeE.Char)
         {
             this.WriteChars((char[]) array);
         }
         else
         {
             this.WriteArrayAsBytes(array, Converter.TypeLength(arrayElemTypeNameInfo.NIprimitiveTypeEnum));
         }
     }
 }
예제 #6
0
        [System.Security.SecurityCritical]  // auto-generated
        internal void WriteSingleArray(NameInfo memberNameInfo, NameInfo arrayNameInfo, WriteObjectInfo objectInfo, NameInfo arrayElemTypeNameInfo, int length, int lowerBound, Array array) 
        { 
            InternalWriteItemNull();
#if _DEBUG 
            arrayNameInfo.Dump("WriteSingleArray arrayNameInfo");
            arrayElemTypeNameInfo.Dump("WriteSingleArray arrayElemTypeNameInfo");
#endif
            BinaryArrayTypeEnum binaryArrayTypeEnum; 
            Int32[] lengthA = new Int32[1];
            lengthA[0] = length; 
            Int32[] lowerBoundA = null; 
            Object typeInformation = null;
 
            if (lowerBound == 0)
            {
                binaryArrayTypeEnum = BinaryArrayTypeEnum.Single;
            } 
            else
            { 
                binaryArrayTypeEnum = BinaryArrayTypeEnum.SingleOffset; 
                lowerBoundA = new Int32[1];
                lowerBoundA[0] = lowerBound; 
            }

            int assemId;
 
            BinaryTypeEnum binaryTypeEnum = BinaryConverter.GetBinaryTypeInfo(arrayElemTypeNameInfo.NItype, objectInfo, arrayElemTypeNameInfo.NIname, objectWriter, out typeInformation, out assemId);
 
            if (binaryArray == null) 
                binaryArray = new BinaryArray();
            binaryArray.Set((int)arrayNameInfo.NIobjectId, (int)1, lengthA, lowerBoundA, binaryTypeEnum, typeInformation, binaryArrayTypeEnum, assemId); 

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

            if (Converter.IsWriteAsByteArray(arrayElemTypeNameInfo.NIprimitiveTypeEnum) && (lowerBound == 0))
            {
                //array is written out as an array of bytes 
                if (arrayElemTypeNameInfo.NIprimitiveTypeEnum == InternalPrimitiveTypeE.Byte)
                    WriteBytes((Byte[])array); 
                else if (arrayElemTypeNameInfo.NIprimitiveTypeEnum == InternalPrimitiveTypeE.Char) 
                    WriteChars((char[])array);
                else 
                    WriteArrayAsBytes(array, Converter.TypeLength(arrayElemTypeNameInfo.NIprimitiveTypeEnum));
            }
        }
 internal void WriteJaggedArray(NameInfo memberNameInfo, NameInfo arrayNameInfo, WriteObjectInfo objectInfo, NameInfo arrayElemTypeNameInfo, int length, int lowerBound)
 {
     BinaryArrayTypeEnum jagged;
     this.InternalWriteItemNull();
     int[] lengthA = new int[] { length };
     int[] lowerBoundA = null;
     object typeInformation = null;
     int assemId = 0;
     if (lowerBound == 0)
     {
         jagged = BinaryArrayTypeEnum.Jagged;
     }
     else
     {
         jagged = BinaryArrayTypeEnum.JaggedOffset;
         lowerBoundA = new int[] { lowerBound };
     }
     BinaryTypeEnum binaryTypeEnum = BinaryConverter.GetBinaryTypeInfo(arrayElemTypeNameInfo.NItype, objectInfo, arrayElemTypeNameInfo.NIname, this.objectWriter, out typeInformation, out assemId);
     if (this.binaryArray == null)
     {
         this.binaryArray = new BinaryArray();
     }
     this.binaryArray.Set((int) arrayNameInfo.NIobjectId, 1, lengthA, lowerBoundA, binaryTypeEnum, typeInformation, jagged, assemId);
     long nIobjectId = arrayNameInfo.NIobjectId;
     this.binaryArray.Write(this);
 }
 internal void WriteRectangleArray(NameInfo memberNameInfo, NameInfo arrayNameInfo, WriteObjectInfo objectInfo, NameInfo arrayElemTypeNameInfo, int rank, int[] lengthA, int[] lowerBoundA)
 {
     this.InternalWriteItemNull();
     BinaryArrayTypeEnum rectangular = BinaryArrayTypeEnum.Rectangular;
     object typeInformation = null;
     int assemId = 0;
     BinaryTypeEnum binaryTypeEnum = BinaryConverter.GetBinaryTypeInfo(arrayElemTypeNameInfo.NItype, objectInfo, arrayElemTypeNameInfo.NIname, this.objectWriter, out typeInformation, out assemId);
     if (this.binaryArray == null)
     {
         this.binaryArray = new BinaryArray();
     }
     for (int i = 0; i < rank; i++)
     {
         if (lowerBoundA[i] != 0)
         {
             rectangular = BinaryArrayTypeEnum.RectangularOffset;
             break;
         }
     }
     this.binaryArray.Set((int) arrayNameInfo.NIobjectId, rank, lengthA, lowerBoundA, binaryTypeEnum, typeInformation, rectangular, assemId);
     long nIobjectId = arrayNameInfo.NIobjectId;
     this.binaryArray.Write(this);
 }
예제 #9
0
        private void ReadArray(BinaryHeaderEnum binaryHeaderEnum)
        {
            BinaryArray binaryArray = new BinaryArray(binaryHeaderEnum);

            binaryArray.Read(this);
            BinaryAssemblyInfo assemblyInfo;

            if (binaryArray.binaryTypeEnum == BinaryTypeEnum.ObjectUser)
            {
                if (binaryArray.assemId < 1)
                {
                    throw new SerializationException(Environment.GetResourceString("Serialization_AssemblyId", binaryArray.typeInformation));
                }
                assemblyInfo = (BinaryAssemblyInfo)this.AssemIdToAssemblyTable[binaryArray.assemId];
            }
            else
            {
                assemblyInfo = this.SystemAssemblyInfo;
            }
            ObjectProgress op = this.GetOp();
            ParseRecord    pr = op.pr;

            op.objectTypeEnum  = InternalObjectTypeE.Array;
            op.binaryTypeEnum  = binaryArray.binaryTypeEnum;
            op.typeInformation = binaryArray.typeInformation;
            ObjectProgress objectProgress = (ObjectProgress)this.stack.PeekPeek();

            if (objectProgress == null || binaryArray.objectId > 0)
            {
                op.name            = "System.Array";
                pr.PRparseTypeEnum = InternalParseTypeE.Object;
                op.memberValueEnum = InternalMemberValueE.Empty;
            }
            else
            {
                pr.PRparseTypeEnum   = InternalParseTypeE.Member;
                pr.PRmemberValueEnum = InternalMemberValueE.Nested;
                op.memberValueEnum   = InternalMemberValueE.Nested;
                switch (objectProgress.objectTypeEnum)
                {
                case InternalObjectTypeE.Object:
                    pr.PRname           = objectProgress.name;
                    pr.PRmemberTypeEnum = InternalMemberTypeE.Field;
                    op.memberTypeEnum   = InternalMemberTypeE.Field;
                    pr.PRkeyDt          = objectProgress.name;
                    pr.PRdtType         = objectProgress.dtType;
                    break;

                case InternalObjectTypeE.Array:
                    pr.PRmemberTypeEnum = InternalMemberTypeE.Item;
                    op.memberTypeEnum   = InternalMemberTypeE.Item;
                    break;

                default:
                    throw new SerializationException(Environment.GetResourceString("Serialization_ObjectTypeEnum", (object)objectProgress.objectTypeEnum.ToString()));
                }
            }
            pr.PRobjectId           = this.objectReader.GetId((long)binaryArray.objectId);
            pr.PRobjectPositionEnum = pr.PRobjectId != this.topId ? (this.headerId <= 0L || pr.PRobjectId != this.headerId ? InternalObjectPositionE.Child : InternalObjectPositionE.Headers) : InternalObjectPositionE.Top;
            pr.PRobjectTypeEnum     = InternalObjectTypeE.Array;
            BinaryConverter.TypeFromInfo(binaryArray.binaryTypeEnum, binaryArray.typeInformation, this.objectReader, assemblyInfo, out pr.PRarrayElementTypeCode, out pr.PRarrayElementTypeString, out pr.PRarrayElementType, out pr.PRisArrayVariant);
            pr.PRdtTypeCode  = InternalPrimitiveTypeE.Invalid;
            pr.PRrank        = binaryArray.rank;
            pr.PRlengthA     = binaryArray.lengthA;
            pr.PRlowerBoundA = binaryArray.lowerBoundA;
            bool flag = false;

            switch (binaryArray.binaryArrayTypeEnum)
            {
            case BinaryArrayTypeEnum.Single:
            case BinaryArrayTypeEnum.SingleOffset:
                op.numItems        = binaryArray.lengthA[0];
                pr.PRarrayTypeEnum = InternalArrayTypeE.Single;
                if (Converter.IsWriteAsByteArray(pr.PRarrayElementTypeCode) && binaryArray.lowerBoundA[0] == 0)
                {
                    flag = true;
                    this.ReadArrayAsBytes(pr);
                    break;
                }
                break;

            case BinaryArrayTypeEnum.Jagged:
            case BinaryArrayTypeEnum.JaggedOffset:
                op.numItems        = binaryArray.lengthA[0];
                pr.PRarrayTypeEnum = InternalArrayTypeE.Jagged;
                break;

            case BinaryArrayTypeEnum.Rectangular:
            case BinaryArrayTypeEnum.RectangularOffset:
                int num = 1;
                for (int index = 0; index < binaryArray.rank; ++index)
                {
                    num *= binaryArray.lengthA[index];
                }
                op.numItems        = num;
                pr.PRarrayTypeEnum = InternalArrayTypeE.Rectangular;
                break;

            default:
                throw new SerializationException(Environment.GetResourceString("Serialization_ArrayType", (object)binaryArray.binaryArrayTypeEnum.ToString()));
            }
            if (!flag)
            {
                this.stack.Push((object)op);
            }
            else
            {
                this.PutOp(op);
            }
            this.objectReader.Parse(pr);
            if (!flag)
            {
                return;
            }
            pr.PRparseTypeEnum = InternalParseTypeE.ObjectEnd;
            this.objectReader.Parse(pr);
        }
        private void ReadArray(BinaryHeaderEnum binaryHeaderEnum)
        {
            BinaryAssemblyInfo assemblyInfo = null;
            BinaryArray array = new BinaryArray(binaryHeaderEnum);
            array.Read(this);
            if (array.binaryTypeEnum == BinaryTypeEnum.ObjectUser)
            {
                if (array.assemId < 1)
                {
                    throw new SerializationException(Environment.GetResourceString("Serialization_AssemblyId", new object[] { array.typeInformation }));
                }
                assemblyInfo = (BinaryAssemblyInfo) this.AssemIdToAssemblyTable[array.assemId];
            }
            else
            {
                assemblyInfo = this.SystemAssemblyInfo;
            }
            ObjectProgress op = this.GetOp();
            ParseRecord pr = op.pr;
            op.objectTypeEnum = InternalObjectTypeE.Array;
            op.binaryTypeEnum = array.binaryTypeEnum;
            op.typeInformation = array.typeInformation;
            ObjectProgress progress2 = (ObjectProgress) this.stack.PeekPeek();
            if ((progress2 == null) || (array.objectId > 0))
            {
                op.name = "System.Array";
                pr.PRparseTypeEnum = InternalParseTypeE.Object;
                op.memberValueEnum = InternalMemberValueE.Empty;
            }
            else
            {
                pr.PRparseTypeEnum = InternalParseTypeE.Member;
                pr.PRmemberValueEnum = InternalMemberValueE.Nested;
                op.memberValueEnum = InternalMemberValueE.Nested;
                switch (progress2.objectTypeEnum)
                {
                    case InternalObjectTypeE.Object:
                        pr.PRname = progress2.name;
                        pr.PRmemberTypeEnum = InternalMemberTypeE.Field;
                        op.memberTypeEnum = InternalMemberTypeE.Field;
                        pr.PRkeyDt = progress2.name;
                        pr.PRdtType = progress2.dtType;
                        goto Label_0177;

                    case InternalObjectTypeE.Array:
                        pr.PRmemberTypeEnum = InternalMemberTypeE.Item;
                        op.memberTypeEnum = InternalMemberTypeE.Item;
                        goto Label_0177;
                }
                throw new SerializationException(Environment.GetResourceString("Serialization_ObjectTypeEnum", new object[] { progress2.objectTypeEnum.ToString() }));
            }
        Label_0177:
            pr.PRobjectId = this.objectReader.GetId((long) array.objectId);
            if (pr.PRobjectId == this.topId)
            {
                pr.PRobjectPositionEnum = InternalObjectPositionE.Top;
            }
            else if ((this.headerId > 0L) && (pr.PRobjectId == this.headerId))
            {
                pr.PRobjectPositionEnum = InternalObjectPositionE.Headers;
            }
            else
            {
                pr.PRobjectPositionEnum = InternalObjectPositionE.Child;
            }
            pr.PRobjectTypeEnum = InternalObjectTypeE.Array;
            BinaryConverter.TypeFromInfo(array.binaryTypeEnum, array.typeInformation, this.objectReader, assemblyInfo, out pr.PRarrayElementTypeCode, out pr.PRarrayElementTypeString, out pr.PRarrayElementType, out pr.PRisArrayVariant);
            pr.PRdtTypeCode = InternalPrimitiveTypeE.Invalid;
            pr.PRrank = array.rank;
            pr.PRlengthA = array.lengthA;
            pr.PRlowerBoundA = array.lowerBoundA;
            bool flag = false;
            switch (array.binaryArrayTypeEnum)
            {
                case BinaryArrayTypeEnum.Single:
                case BinaryArrayTypeEnum.SingleOffset:
                    op.numItems = array.lengthA[0];
                    pr.PRarrayTypeEnum = InternalArrayTypeE.Single;
                    if (Converter.IsWriteAsByteArray(pr.PRarrayElementTypeCode) && (array.lowerBoundA[0] == 0))
                    {
                        flag = true;
                        this.ReadArrayAsBytes(pr);
                    }
                    break;

                case BinaryArrayTypeEnum.Jagged:
                case BinaryArrayTypeEnum.JaggedOffset:
                    op.numItems = array.lengthA[0];
                    pr.PRarrayTypeEnum = InternalArrayTypeE.Jagged;
                    break;

                case BinaryArrayTypeEnum.Rectangular:
                case BinaryArrayTypeEnum.RectangularOffset:
                {
                    int num = 1;
                    for (int i = 0; i < array.rank; i++)
                    {
                        num *= array.lengthA[i];
                    }
                    op.numItems = num;
                    pr.PRarrayTypeEnum = InternalArrayTypeE.Rectangular;
                    break;
                }
                default:
                    throw new SerializationException(Environment.GetResourceString("Serialization_ArrayType", new object[] { array.binaryArrayTypeEnum.ToString() }));
            }
            if (!flag)
            {
                this.stack.Push(op);
            }
            else
            {
                this.PutOp(op);
            }
            this.objectReader.Parse(pr);
            if (flag)
            {
                pr.PRparseTypeEnum = InternalParseTypeE.ObjectEnd;
                this.objectReader.Parse(pr);
            }
        }
        private void ReadArray(BinaryHeaderEnum binaryHeaderEnum)
        {
            BinaryAssemblyInfo?assemblyInfo = null;
            BinaryArray        record       = new BinaryArray(binaryHeaderEnum);

            record.Read(this);

            if (record._binaryTypeEnum == BinaryTypeEnum.ObjectUser)
            {
                if (record._assemId < 1)
                {
                    throw new SerializationException(SR.Format(SR.Serialization_AssemblyId, record._typeInformation));
                }
                assemblyInfo = (BinaryAssemblyInfo?)AssemIdToAssemblyTable[record._assemId];
            }
            else
            {
                assemblyInfo = SystemAssemblyInfo; //Urt assembly
            }

            ObjectProgress op = GetOp();
            ParseRecord    pr = op._pr;

            op._objectTypeEnum  = InternalObjectTypeE.Array;
            op._binaryTypeEnum  = record._binaryTypeEnum;
            op._typeInformation = record._typeInformation;

            ObjectProgress?objectOp = (ObjectProgress?)_stack.PeekPeek();

            if ((objectOp == null) || (record._objectId > 0))
            {
                // Non-Nested Object
                op._name            = "System.Array";
                pr._parseTypeEnum   = InternalParseTypeE.Object;
                op._memberValueEnum = InternalMemberValueE.Empty;
            }
            else
            {
                // Nested Object
                pr._parseTypeEnum   = InternalParseTypeE.Member;
                pr._memberValueEnum = InternalMemberValueE.Nested;
                op._memberValueEnum = InternalMemberValueE.Nested;

                switch (objectOp._objectTypeEnum)
                {
                case InternalObjectTypeE.Object:
                    pr._name           = objectOp._name;
                    pr._memberTypeEnum = InternalMemberTypeE.Field;
                    op._memberTypeEnum = InternalMemberTypeE.Field;
                    pr._keyDt          = objectOp._name;
                    pr._dtType         = objectOp._dtType;
                    break;

                case InternalObjectTypeE.Array:
                    pr._memberTypeEnum = InternalMemberTypeE.Item;
                    op._memberTypeEnum = InternalMemberTypeE.Item;
                    break;

                default:
                    throw new SerializationException(SR.Format(SR.Serialization_ObjectTypeEnum, objectOp._objectTypeEnum.ToString()));
                }
            }

            pr._objectId = _objectReader.GetId(record._objectId);
            if (pr._objectId == _topId)
            {
                pr._objectPositionEnum = InternalObjectPositionE.Top;
            }
            else if ((_headerId > 0) && (pr._objectId == _headerId))
            {
                pr._objectPositionEnum = InternalObjectPositionE.Headers; // Headers are an array of header objects
            }
            else
            {
                pr._objectPositionEnum = InternalObjectPositionE.Child;
            }

            pr._objectTypeEnum = InternalObjectTypeE.Array;

            BinaryTypeConverter.TypeFromInfo(record._binaryTypeEnum, record._typeInformation, _objectReader, assemblyInfo,
                                             out pr._arrayElementTypeCode, out pr._arrayElementTypeString,
                                             out pr._arrayElementType, out pr._isArrayVariant);

            pr._dtTypeCode = InternalPrimitiveTypeE.Invalid;

            pr._rank        = record._rank;
            pr._lengthA     = record._lengthA;
            pr._lowerBoundA = record._lowerBoundA;
            bool isPrimitiveArray = false;

            Debug.Assert(record._lengthA != null);
            switch (record._binaryArrayTypeEnum)
            {
            case BinaryArrayTypeEnum.Single:
            case BinaryArrayTypeEnum.SingleOffset:
                op._numItems      = record._lengthA[0];
                pr._arrayTypeEnum = InternalArrayTypeE.Single;
                Debug.Assert(record._lowerBoundA != null);
                if (Converter.IsWriteAsByteArray(pr._arrayElementTypeCode) &&
                    (record._lowerBoundA[0] == 0))
                {
                    isPrimitiveArray = true;
                    ReadArrayAsBytes(pr);
                }
                break;

            case BinaryArrayTypeEnum.Jagged:
            case BinaryArrayTypeEnum.JaggedOffset:
                op._numItems      = record._lengthA[0];
                pr._arrayTypeEnum = InternalArrayTypeE.Jagged;
                break;

            case BinaryArrayTypeEnum.Rectangular:
            case BinaryArrayTypeEnum.RectangularOffset:
                int arrayLength = 1;
                for (int i = 0; i < record._rank; i++)
                {
                    arrayLength = arrayLength * record._lengthA[i];
                }
                op._numItems      = arrayLength;
                pr._arrayTypeEnum = InternalArrayTypeE.Rectangular;
                break;

            default:
                throw new SerializationException(SR.Format(SR.Serialization_ArrayType, record._binaryArrayTypeEnum.ToString()));
            }

            if (!isPrimitiveArray)
            {
                _stack.Push(op);
            }
            else
            {
                PutOp(op);
            }

            _objectReader.Parse(pr);

            if (isPrimitiveArray)
            {
                pr._parseTypeEnum = InternalParseTypeE.ObjectEnd;
                _objectReader.Parse(pr);
            }
        }
        private void ReadArray(BinaryHeaderEnum binaryHeaderEnum)
        {
            BinaryAssemblyInfo assemblyInfo = null;
            BinaryArray        array        = new BinaryArray(binaryHeaderEnum);

            array.Read(this);
            if (array.binaryTypeEnum == BinaryTypeEnum.ObjectUser)
            {
                if (array.assemId < 1)
                {
                    throw new SerializationException(Environment.GetResourceString("Serialization_AssemblyId", new object[] { array.typeInformation }));
                }
                assemblyInfo = (BinaryAssemblyInfo)this.AssemIdToAssemblyTable[array.assemId];
            }
            else
            {
                assemblyInfo = this.SystemAssemblyInfo;
            }
            ObjectProgress op = this.GetOp();
            ParseRecord    pr = op.pr;

            op.objectTypeEnum  = InternalObjectTypeE.Array;
            op.binaryTypeEnum  = array.binaryTypeEnum;
            op.typeInformation = array.typeInformation;
            ObjectProgress progress2 = (ObjectProgress)this.stack.PeekPeek();

            if ((progress2 == null) || (array.objectId > 0))
            {
                op.name            = "System.Array";
                pr.PRparseTypeEnum = InternalParseTypeE.Object;
                op.memberValueEnum = InternalMemberValueE.Empty;
            }
            else
            {
                pr.PRparseTypeEnum   = InternalParseTypeE.Member;
                pr.PRmemberValueEnum = InternalMemberValueE.Nested;
                op.memberValueEnum   = InternalMemberValueE.Nested;
                switch (progress2.objectTypeEnum)
                {
                case InternalObjectTypeE.Object:
                    pr.PRname           = progress2.name;
                    pr.PRmemberTypeEnum = InternalMemberTypeE.Field;
                    op.memberTypeEnum   = InternalMemberTypeE.Field;
                    pr.PRkeyDt          = progress2.name;
                    pr.PRdtType         = progress2.dtType;
                    goto Label_0177;

                case InternalObjectTypeE.Array:
                    pr.PRmemberTypeEnum = InternalMemberTypeE.Item;
                    op.memberTypeEnum   = InternalMemberTypeE.Item;
                    goto Label_0177;
                }
                throw new SerializationException(Environment.GetResourceString("Serialization_ObjectTypeEnum", new object[] { progress2.objectTypeEnum.ToString() }));
            }
Label_0177:
            pr.PRobjectId = this.objectReader.GetId((long)array.objectId);
            if (pr.PRobjectId == this.topId)
            {
                pr.PRobjectPositionEnum = InternalObjectPositionE.Top;
            }
            else if ((this.headerId > 0L) && (pr.PRobjectId == this.headerId))
            {
                pr.PRobjectPositionEnum = InternalObjectPositionE.Headers;
            }
            else
            {
                pr.PRobjectPositionEnum = InternalObjectPositionE.Child;
            }
            pr.PRobjectTypeEnum = InternalObjectTypeE.Array;
            BinaryConverter.TypeFromInfo(array.binaryTypeEnum, array.typeInformation, this.objectReader, assemblyInfo, out pr.PRarrayElementTypeCode, out pr.PRarrayElementTypeString, out pr.PRarrayElementType, out pr.PRisArrayVariant);
            pr.PRdtTypeCode  = InternalPrimitiveTypeE.Invalid;
            pr.PRrank        = array.rank;
            pr.PRlengthA     = array.lengthA;
            pr.PRlowerBoundA = array.lowerBoundA;
            bool flag = false;

            switch (array.binaryArrayTypeEnum)
            {
            case BinaryArrayTypeEnum.Single:
            case BinaryArrayTypeEnum.SingleOffset:
                op.numItems        = array.lengthA[0];
                pr.PRarrayTypeEnum = InternalArrayTypeE.Single;
                if (Converter.IsWriteAsByteArray(pr.PRarrayElementTypeCode) && (array.lowerBoundA[0] == 0))
                {
                    flag = true;
                    this.ReadArrayAsBytes(pr);
                }
                break;

            case BinaryArrayTypeEnum.Jagged:
            case BinaryArrayTypeEnum.JaggedOffset:
                op.numItems        = array.lengthA[0];
                pr.PRarrayTypeEnum = InternalArrayTypeE.Jagged;
                break;

            case BinaryArrayTypeEnum.Rectangular:
            case BinaryArrayTypeEnum.RectangularOffset:
            {
                int num = 1;
                for (int i = 0; i < array.rank; i++)
                {
                    num *= array.lengthA[i];
                }
                op.numItems        = num;
                pr.PRarrayTypeEnum = InternalArrayTypeE.Rectangular;
                break;
            }

            default:
                throw new SerializationException(Environment.GetResourceString("Serialization_ArrayType", new object[] { array.binaryArrayTypeEnum.ToString() }));
            }
            if (!flag)
            {
                this.stack.Push(op);
            }
            else
            {
                this.PutOp(op);
            }
            this.objectReader.Parse(pr);
            if (flag)
            {
                pr.PRparseTypeEnum = InternalParseTypeE.ObjectEnd;
                this.objectReader.Parse(pr);
            }
        }
예제 #13
0
        internal void WriteJaggedArray(NameInfo memberNameInfo, NameInfo arrayNameInfo, WriteObjectInfo objectInfo, NameInfo arrayElemTypeNameInfo, int length, int lowerBound)
        {
            InternalWriteItemNull();
            BinaryArrayTypeEnum binaryArrayTypeEnum;
            var lengthA = new int[1];
            lengthA[0] = length;
            int[] lowerBoundA = null;
            object typeInformation = null;
            int assemId = 0;

            if (lowerBound == 0)
            {
                binaryArrayTypeEnum = BinaryArrayTypeEnum.Jagged;
            }
            else
            {
                binaryArrayTypeEnum = BinaryArrayTypeEnum.JaggedOffset;
                lowerBoundA = new int[1];
                lowerBoundA[0] = lowerBound;
            }

            BinaryTypeEnum binaryTypeEnum = BinaryTypeConverter.GetBinaryTypeInfo(arrayElemTypeNameInfo._type, objectInfo, arrayElemTypeNameInfo.NIname, _objectWriter, out typeInformation, out assemId);

            if (_binaryArray == null)
            {
                _binaryArray = new BinaryArray();
            }
            _binaryArray.Set((int)arrayNameInfo._objectId, 1, lengthA, lowerBoundA, binaryTypeEnum, typeInformation, binaryArrayTypeEnum, assemId);

            _binaryArray.Write(this);
        }
예제 #14
0
        internal void WriteSingleArray(NameInfo memberNameInfo, NameInfo arrayNameInfo, WriteObjectInfo objectInfo, NameInfo arrayElemTypeNameInfo, int length, int lowerBound, Array array)
        {
            InternalWriteItemNull();
            BinaryArrayTypeEnum binaryArrayTypeEnum;
            var lengthA = new int[1];
            lengthA[0] = length;
            int[] lowerBoundA = null;
            object typeInformation = null;

            if (lowerBound == 0)
            {
                binaryArrayTypeEnum = BinaryArrayTypeEnum.Single;
            }
            else
            {
                binaryArrayTypeEnum = BinaryArrayTypeEnum.SingleOffset;
                lowerBoundA = new int[1];
                lowerBoundA[0] = lowerBound;
            }

            int assemId;
            BinaryTypeEnum binaryTypeEnum = BinaryTypeConverter.GetBinaryTypeInfo(
                arrayElemTypeNameInfo._type, objectInfo, arrayElemTypeNameInfo.NIname, _objectWriter, out typeInformation, out assemId);

            if (_binaryArray == null)
            {
                _binaryArray = new BinaryArray();
            }
            _binaryArray.Set((int)arrayNameInfo._objectId, 1, lengthA, lowerBoundA, binaryTypeEnum, typeInformation, binaryArrayTypeEnum, assemId);

            _binaryArray.Write(this);

            if (Converter.IsWriteAsByteArray(arrayElemTypeNameInfo._primitiveTypeEnum) && (lowerBound == 0))
            {
                //array is written out as an array of bytes
                if (arrayElemTypeNameInfo._primitiveTypeEnum == InternalPrimitiveTypeE.Byte)
                {
                    WriteBytes((byte[])array);
                }
                else if (arrayElemTypeNameInfo._primitiveTypeEnum == InternalPrimitiveTypeE.Char)
                {
                    WriteChars((char[])array);
                }
                else
                {
                    WriteArrayAsBytes(array, Converter.TypeLength(arrayElemTypeNameInfo._primitiveTypeEnum));
                }
            }
        }
예제 #15
0
        private void ReadArray(BinaryHeaderEnum binaryHeaderEnum)
        {
            BinaryAssemblyInfo assemblyInfo = null;

            SerTrace.Log(this, "ReadArray ");
            BinaryArray record = new BinaryArray(binaryHeaderEnum);

            record.Read(this);
            record.Dump();

            SerTrace.Log(this, "Read 1 ", ((Enum)binaryHeaderEnum).ToString());

            if (record.binaryTypeEnum == BinaryTypeEnum.ObjectUser)
            {
                if (record.assemId < 1)
                {
                    throw new SerializationException(String.Format(Environment.GetResourceString("Serialization_AssemblyId"), record.typeInformation));
                }

                assemblyInfo = (BinaryAssemblyInfo)AssemIdToAssemblyTable[record.assemId];
                SerTrace.Log(this, "ReadArray  lookup assemIdToAssembly assemId ", record.assemId, " assembly ", assemblyInfo.assemblyString);
            }
            else
            {
                assemblyInfo = SystemAssemblyInfo;                 //Urt assembly
            }
            ObjectProgress op = GetOp();
            ParseRecord    pr = op.pr;

            op.objectTypeEnum  = InternalObjectTypeE.Array;
            op.binaryTypeEnum  = record.binaryTypeEnum;
            op.typeInformation = record.typeInformation;

            ObjectProgress objectOp = (ObjectProgress)stack.PeekPeek();

            if ((objectOp == null) || (record.objectId > 0))
            {
                // Non-Nested Object
                op.name            = "System.Array";
                pr.PRparseTypeEnum = InternalParseTypeE.Object;
                op.memberValueEnum = InternalMemberValueE.Empty;
            }
            else
            {
                // Nested Object
                pr.PRparseTypeEnum   = InternalParseTypeE.Member;
                pr.PRmemberValueEnum = InternalMemberValueE.Nested;
                op.memberValueEnum   = InternalMemberValueE.Nested;

                switch (objectOp.objectTypeEnum)
                {
                case InternalObjectTypeE.Object:
                    pr.PRname           = objectOp.name;
                    pr.PRmemberTypeEnum = InternalMemberTypeE.Field;
                    op.memberTypeEnum   = InternalMemberTypeE.Field;
                    pr.PRkeyDt          = objectOp.name;
                    pr.PRdtType         = objectOp.dtType;
                    break;

                case InternalObjectTypeE.Array:
                    pr.PRmemberTypeEnum = InternalMemberTypeE.Item;
                    op.memberTypeEnum   = InternalMemberTypeE.Item;
                    break;

                default:
                    throw new SerializationException(String.Format(Environment.GetResourceString("Serialization_ObjectTypeEnum"), ((Enum)objectOp.objectTypeEnum).ToString()));
                }
            }


            pr.PRobjectId = objectReader.GetId((long)record.objectId);
            if (pr.PRobjectId == topId)
            {
                pr.PRobjectPositionEnum = InternalObjectPositionE.Top;
            }
            else if ((headerId > 0) && (pr.PRobjectId == headerId))
            {
                pr.PRobjectPositionEnum = InternalObjectPositionE.Headers;                 // Headers are an array of header objects
            }
            else
            {
                pr.PRobjectPositionEnum = InternalObjectPositionE.Child;
            }

            pr.PRobjectTypeEnum = InternalObjectTypeE.Array;

            BinaryConverter.TypeFromInfo(record.binaryTypeEnum, record.typeInformation, objectReader, assemblyInfo,
                                         out pr.PRarrayElementTypeCode, out pr.PRarrayElementTypeString,
                                         out pr.PRarrayElementType, out pr.PRisArrayVariant);

            pr.PRdtTypeCode = InternalPrimitiveTypeE.Invalid;


            pr.PRrank        = record.rank;
            pr.PRlengthA     = record.lengthA;
            pr.PRlowerBoundA = record.lowerBoundA;
            bool isPrimitiveArray = false;

            switch (record.binaryArrayTypeEnum)
            {
            case BinaryArrayTypeEnum.Single:
            case BinaryArrayTypeEnum.SingleOffset:
                op.numItems        = record.lengthA[0];
                pr.PRarrayTypeEnum = InternalArrayTypeE.Single;
                if (Converter.IsWriteAsByteArray(pr.PRarrayElementTypeCode) &&
                    (record.lowerBoundA[0] == 0))
                {
                    isPrimitiveArray = true;
                    ReadArrayAsBytes(pr);
                }
                break;

            case BinaryArrayTypeEnum.Jagged:
            case BinaryArrayTypeEnum.JaggedOffset:
                op.numItems        = record.lengthA[0];
                pr.PRarrayTypeEnum = InternalArrayTypeE.Jagged;
                break;

            case BinaryArrayTypeEnum.Rectangular:
            case BinaryArrayTypeEnum.RectangularOffset:
                int arrayLength = 1;
                for (int i = 0; i < record.rank; i++)
                {
                    arrayLength = arrayLength * record.lengthA[i];
                }
                op.numItems        = arrayLength;
                pr.PRarrayTypeEnum = InternalArrayTypeE.Rectangular;
                break;

            default:
                throw new SerializationException(String.Format(Environment.GetResourceString("Serialization_ArrayType"), ((Enum)record.binaryArrayTypeEnum).ToString()));
            }

            if (!isPrimitiveArray)
            {
                stack.Push(op);
            }
            else
            {
                PutOp(op);
            }

            SerTrace.Log(this, "ReadArray ", ((Enum)record.binaryArrayTypeEnum).ToString(), " length ", op.numItems);
            objectReader.Parse(pr);

            if (isPrimitiveArray)
            {
                pr.PRparseTypeEnum = InternalParseTypeE.ObjectEnd;
                objectReader.Parse(pr);
            }
        }