public static void WriteMessage(Message msg, TextWriter w) { w.WriteLine("# Message"); w.WriteLine("# Header"); MessageDumper.WriteBlock(msg.GetHeaderData(), w); w.WriteLine("# Body"); MessageDumper.WriteBlock(msg.Body, w); w.WriteLine(); w.Flush(); }
public static Message ReadMessage(TextReader r) { byte[] header = MessageDumper.ReadBlock(r); if (header == null) { return(null); } byte[] body = MessageDumper.ReadBlock(r); return(Message.FromReceivedBytes(null, header, body)); }