示例#1
0
        public static byte[] EncodeAlertPayload(AlertPayload alertPayload)
        {
            var stream = new MemoryStream();

            EncodeAlertPayload(stream, alertPayload);
            return(stream.ToArray());
        }
示例#2
0
 public static void EncodeAlertPayload(Stream stream, AlertPayload alertPayload)
 {
     using (var writer = new BinaryWriter(stream, Encoding.ASCII, leaveOpen: true))
     {
         writer.WriteVarString(alertPayload.Payload);
         writer.WriteVarString(alertPayload.Signature);
     }
 }
示例#3
0
 public static byte[] EncodeAlertPayload(AlertPayload alertPayload)
 {
     using (var stream = new MemoryStream())
         using (var writer = new BinaryWriter(stream))
         {
             EncodeAlertPayload(writer, alertPayload);
             return(stream.ToArray());
         }
 }
示例#4
0
 public static void EncodeAlertPayload(BinaryWriter writer, AlertPayload alertPayload)
 {
     writer.WriteVarString(alertPayload.Payload);
     writer.WriteVarString(alertPayload.Signature);
 }
示例#5
0
 public static byte[] EncodeAlertPayload(AlertPayload alertPayload)
 {
     var stream = new MemoryStream();
     EncodeAlertPayload(stream, alertPayload);
     return stream.ToArray();
 }
示例#6
0
 public static void EncodeAlertPayload(Stream stream, AlertPayload alertPayload)
 {
     using (var writer = new BinaryWriter(stream, Encoding.ASCII, leaveOpen: true))
     {
         writer.WriteVarString(alertPayload.Payload);
         writer.WriteVarString(alertPayload.Signature);
     }
 }