Exemplo n.º 1
0
 protected override byte[] GetPayload()
 {
     using var mem    = new MemoryStream(Versions.Length * sizeof(ushort));
     using var writer = new BEBinaryWriter(mem);
     foreach (var ver in Versions)
     {
         writer.Write(ver);
     }
     return(mem.ToArray());
 }
Exemplo n.º 2
0
 public void WriteTo(Stream stream, int protocolVersion)
 {
     using (var w = new BEBinaryWriter(stream))
     {
         if (protocolVersion >= 4)
         {
             w.Write((uint)CircuitId);
         }
         else
         {
             w.Write((ushort)CircuitId);
         }
         w.Write((byte)Command);
         WritePayload(w);
         w.Flush();
     }
 }