public void Skip(MemoryStream memoryStream)
        {
            memoryStream.ReadByte();
            memoryStream.ReadByte();
            memoryStream.ReadLEShort();
            byte typeId;

            do
            {
                typeId = memoryStream.PeekByte();
                var handler = BinarySerializationSegment.GetFor(typeId);
                handler.Skip(memoryStream);
            } while (typeId != BinarySerializationSegment.EndVariableLengthObjectSegment.TypeId);
        }
示例#2
0
        public void Skip(MemoryStream memoryStream)
        {
            memoryStream.ReadByte();
            memoryStream.ReadLEShort();
            memoryStream.ReadLEShort();
            memoryStream.ReadStringHaving7bitVariableLengthInt32Prefix();
            byte typeId;

            do
            {
                typeId = memoryStream.PeekByte();
                var handler = BinarySerializationSegment.GetFor(typeId);
                handler.Skip(memoryStream);
            } while (typeId != BinarySerializationSegment.EndVariableLengthObjectSegment.TypeId &&
                     typeId != BinarySerializationSegment.ObjectReferenceSegment.TypeId);
        }
示例#3
0
        public void Skip(MemoryStream memoryStream)
        {
            SkipPrefix(memoryStream);
            memoryStream.ReadStringHaving7bitVariableLengthInt32Prefix();
            short propertyCount = memoryStream.ReadLEShort();

            memoryStream.ReadLEShort();
            for (int i = 0; i < propertyCount; i++)
            {
                memoryStream.ReadStringHaving7bitVariableLengthInt32Prefix();
            }
            var propertyTypes = new List <byte>();

            for (int i = 0; i < propertyCount; i++)
            {
                propertyTypes.Add((byte)memoryStream.ReadByte());
            }
            int referencePropertyCount = propertyTypes.Count(x => x == (int)BinarySerializationPropertyType.Reference);

            for (int i = 0; i < referencePropertyCount; i++)
            {
                memoryStream.ReadStringHaving7bitVariableLengthInt32Prefix();
            }
            for (int i = 0; i < referencePropertyCount; i++)
            {
                byte typeId  = memoryStream.PeekByte();
                var  handler = BinarySerializationSegment.GetFor(typeId);
                handler.Skip(memoryStream);
            }
            byte nextTypeId = memoryStream.PeekByte();

            if (nextTypeId == BinarySerializationSegment.EndVariableLengthObjectSegment.TypeId)
            {
                BinarySerializationSegment.EndVariableLengthObjectSegment.Handler.Skip(memoryStream);
                nextTypeId = memoryStream.PeekByte();
            }
            if (nextTypeId != BinarySerializationSegment.VariableLengthObjectSegment.TypeId)
            {
                throw new ArgumentException("Expected next segment to be " + BinarySerializationSegment.VariableLengthObjectSegment.TypeId
                                            + " but was " + nextTypeId);
            }
            // the next segment should contain the text of the StackTrace
        }