Microsoft.Protocols.TestSuites.MS_OXCFXICS.FastTransferStream.ReadMarker C# (CSharp) Method

ReadMarker() public method

Read a Markers value from stream, and advance the position within the stream by 4
public ReadMarker ( ) : Markers
return Markers
        public Markers ReadMarker()
        {
            byte[] buffer = new byte[PidLength];
            int len = this.Read(buffer, 0, PidLength);
            uint marker;
            if (len == PidLength)
            {
                marker = BitConverter.ToUInt32(buffer, 0);
                return (Markers)marker;
            }

            AdapterHelper.Site.Assert.Fail("The stream cannot be deserialized successfully.");

            ////return a invalid value.
            return (Markers)0;
        }

Same methods

FastTransferStream::ReadMarker ( Markers desiredMarker ) : bool

Usage Example

示例#1
0
        /// <summary>
        /// Deserialize fields from a FastTransferStream.
        /// </summary>
        /// <param name="stream">A FastTransferStream.</param>
        public override void Deserialize(FastTransferStream stream)
        {
            if (GroupInfo.Verify(stream))
            {
                this.groupInfo = new GroupInfo(stream);
            }

            if (stream.VerifyMetaProperty(MetaProperties.MetaTagIncrSyncGroupId))
            {
                stream.ReadMarker();
                this.incrSyncGroupId = stream.ReadUInt32();
            }

            if (stream.ReadMarker(Markers.PidTagIncrSyncChgPartial))
            {
                this.messageChangeHeader = new MessageChangeHeader(stream);
                this.propListList        = new List <PropList>();
                while (stream.VerifyMetaProperty(MetaProperties.MetaTagIncrementalSyncMessagePartial))
                {
                    stream.ReadMarker();
                    this.incrementalSyncMessagePartial = stream.ReadUInt32();
                    this.propListList.Add(new PropList(stream));
                }

                this.MessageChildren = new MessageChildren(stream);
                return;
            }

            AdapterHelper.Site.Assert.Fail("The stream cannot be deserialized successfully.");
        }
All Usage Examples Of Microsoft.Protocols.TestSuites.MS_OXCFXICS.FastTransferStream::ReadMarker