Exemplo n.º 1
0
 public byte[] Serialize(AirlockMessage message)
 {
     using (var stream = new MemoryStream())
         using (var writer = new SimpleAirlockBinaryWriter(stream))
         {
             writer.Write((short)1);
             writer.WriteCollection(message.EventGroups, SerializeEventGroup);
             writer.Flush();
             return(stream.ToArray());
         }
 }
Exemplo n.º 2
0
 public byte[] ToArray()
 {
     _writer.Flush();
     return(_writeStream.ToArray());
 }