示例#1
0
 public override Task Write(SourceBufferWriter buf, SourceDemo demo)
 {
     buf.WriteString(TableName.AsSpan());
     buf.WriteUInt16(MaxEntries);
     buf.WriteUBits(Entries, (int)System.Math.Log(MaxEntries, 2) + 1);
     buf.WriteBits(Data.Length, 20);
     buf.WriteBoolean(UserDataFixedSize);
     if (UserDataFixedSize)
     {
         buf.WriteBits(UserDataSize, 12);
     }
     if (UserDataFixedSize)
     {
         buf.WriteBits(UserDataSizeBits, 4);
     }
     buf.WriteBits(Flags, demo.Protocol == 4 ? 2 : 1);
     return(Task.CompletedTask);
 }