Esempio n. 1
0
 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();
 }
Esempio n. 2
0
        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));
        }