Verify() public static method

Verify that a stream's current position contains a serialized groupInfo.
public static Verify ( FastTransferStream stream ) : bool
stream FastTransferStream A FastTransferStream.
return bool
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.");
        }
Example #2
0
 /// <summary>
 /// Verify that a stream's current position contains a serialized MessageChangePartial.
 /// </summary>
 /// <param name="stream">A FastTransferStream.</param>
 /// <returns>If the stream's current position contains
 /// a serialized MessageChangePartial, return true, else false.</returns>
 public static new bool Verify(FastTransferStream stream)
 {
     return(GroupInfo.Verify(stream) ||
            stream.VerifyMetaProperty(MetaProperties.MetaTagIncrSyncGroupId) ||
            stream.VerifyMarker(Markers.PidTagIncrSyncChgPartial));
 }