Verify() public static method

Verify that a stream's current position contains a serialized MessageList.
public static Verify ( FastTransferStream stream ) : bool
stream FastTransferStream A FastTransferStream.
return bool
コード例 #1
0
        /// <summary>
        /// Deserialize fields from a FastTransferStream.
        /// </summary>
        /// <param name="stream">A FastTransferStream.</param>
        public override void Deserialize(FastTransferStream stream)
        {
            int  count    = 0;
            long lastPosi = stream.Position;

            this.fxdelPropList    = new List <uint>();
            this.messageLists     = new List <MessageList>();
            this.messageTupleList = new List <Tuple <List <uint>, MessageList> >();
            while (!stream.IsEndOfStream &&
                   count < 2)
            {
                lastPosi = stream.Position;
                List <uint> metaProps = new List <uint>();
                while (stream.VerifyMetaProperty(MetaProperties.PidTagFXDelProp))
                {
                    stream.ReadMarker();
                    uint delProp = stream.ReadUInt32();
                    metaProps.Add(delProp);
                }

                if (MessageList.Verify(stream))
                {
                    MessageList msgList = new MessageList(stream);

                    this.messageLists.Add(msgList);
                    this.fxdelPropList.AddRange(metaProps);
                    this.messageTupleList.Add(new Tuple <List <uint>, MessageList>(
                                                  metaProps, msgList));
                }
                else
                {
                    stream.Position = lastPosi;
                    break;
                }

                count++;
            }
        }
コード例 #2
0
 /// <summary>
 /// Verify that a stream's current position contains a serialized folderMessages
 /// </summary>
 /// <param name="stream">A FastTransferStream.</param>
 /// <returns>If the stream's current position contains
 /// a serialized folderMessages, return true, else false.</returns>
 public static bool Verify(FastTransferStream stream)
 {
     return(!stream.IsEndOfStream ||
            stream.VerifyMetaProperty(MetaProperties.PidTagFXDelProp) ||
            MessageList.Verify(stream));
 }