示例#1
0
 static void ReadMulticastFooter(int streamVersion, CKBinaryReader r, StreamLogType t, out string gId, out string mId, out int depth, out LogEntryType prevType, out DateTimeStamp prevTime)
 {
     if (streamVersion == 9)
     {
         gId   = r.ReadString();
         mId   = r.ReadString();
         depth = r.ReadNonNegativeSmallInt32();
         Throw.CheckData(mId == GrandOutput.ExternalLogMonitorUniqueId || Base64UrlHelper.IsBase64UrlCharacters(mId));
     }
     else
     {
         gId = GrandOutput.UnknownGrandOutputId;
         Debug.Assert(Guid.Empty.ToByteArray().Length == 16);
         mId   = streamVersion < 8 ? new Guid(r.ReadBytes(16)).ToString() : r.ReadString();
         depth = streamVersion < 6 ? r.ReadInt32() : r.ReadNonNegativeSmallInt32();
         if (streamVersion >= 8)
         {
             Throw.CheckData(mId == GrandOutput.ExternalLogMonitorUniqueId || Base64UrlHelper.IsBase64UrlCharacters(mId));
         }
     }
     Throw.CheckData(gId == GrandOutput.UnknownGrandOutputId || Base64UrlHelper.IsBase64UrlCharacters(gId));
     Throw.CheckData(depth >= 0);
     prevType = LogEntryType.None;
     prevTime = DateTimeStamp.Unknown;
     if ((t & StreamLogType.IsPreviousKnown) != 0)
     {
         prevTime = new DateTimeStamp(DateTime.FromBinary(r.ReadInt64()), (t & StreamLogType.IsPreviousKnownHasUniquifier) != 0 ? r.ReadByte() : (Byte)0);
         prevType = (LogEntryType)r.ReadByte();
     }
 }
示例#2
0
 static void ReadMulticastFooter(int streamVersion, CKBinaryReader r, StreamLogType t, out Guid mId, out int depth, out LogEntryType prevType, out DateTimeStamp prevTime)
 {
     Debug.Assert(Guid.Empty.ToByteArray().Length == 16);
     mId   = new Guid(r.ReadBytes(16));
     depth = streamVersion < 6 ? r.ReadInt32() : r.ReadNonNegativeSmallInt32();
     if (depth < 0)
     {
         throw new InvalidDataException();
     }
     prevType = LogEntryType.None;
     prevTime = DateTimeStamp.Unknown;
     if ((t & StreamLogType.IsPreviousKnown) != 0)
     {
         prevTime = new DateTimeStamp(DateTime.FromBinary(r.ReadInt64()), (t & StreamLogType.IsPreviousKnownHasUniquifier) != 0 ? r.ReadByte() : (Byte)0);
         prevType = (LogEntryType)r.ReadByte();
     }
 }