public static byte[] EncodeAlertPayload(AlertPayload alertPayload) { var stream = new MemoryStream(); EncodeAlertPayload(stream, alertPayload); return(stream.ToArray()); }
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); } }
public static byte[] EncodeAlertPayload(AlertPayload alertPayload) { using (var stream = new MemoryStream()) using (var writer = new BinaryWriter(stream)) { EncodeAlertPayload(writer, alertPayload); return(stream.ToArray()); } }
public static void EncodeAlertPayload(BinaryWriter writer, AlertPayload alertPayload) { writer.WriteVarString(alertPayload.Payload); writer.WriteVarString(alertPayload.Signature); }
public static byte[] EncodeAlertPayload(AlertPayload alertPayload) { var stream = new MemoryStream(); EncodeAlertPayload(stream, alertPayload); return stream.ToArray(); }