Esempio n. 1
0
 /// <summary>
 /// Verify that a stream's current position contains a serialized PropValue.
 /// </summary>
 /// <param name="stream">A FastTransferStream.</param>
 /// <returns>If the stream's current position contains
 /// a serialized PropValue, return true, else false.</returns>
 public static bool Verify(FastTransferStream stream)
 {
     return(!stream.IsEndOfStream &&
            (FixedPropTypePropValue.Verify(stream) ||
             VarPropTypePropValue.Verify(stream) ||
             MvPropTypePropValue.Verify(stream)));
 }
Esempio n. 2
0
 /// <summary>
 /// Deserialize a PropValue instance from a FastTransferStream.
 /// </summary>
 /// <param name="stream">A FastTransferStream.</param>
 /// <returns>A PropValue instance.</returns>
 public static LexicalBase DeserializeFrom(FastTransferStream stream)
 {
     if (FixedPropTypePropValue.Verify(stream))
     {
         return(FixedPropTypePropValue.DeserializeFrom(stream));
     }
     else if (VarPropTypePropValue.Verify(stream))
     {
         return(VarPropTypePropValue.DeserializeFrom(stream));
     }
     else if (MvPropTypePropValue.Verify(stream))
     {
         return(MvPropTypePropValue.DeserializeFrom(stream));
     }
     else
     {
         AdapterHelper.Site.Assert.Fail("The stream cannot be deserialized successfully.");
         return(null);
     }
 }