Example #1
0
        public static byte[] Serialize(WMessage wMessage)
        {
            var s   = new BinaryFormatter();
            var str = new MemoryStream();

            s.Serialize(str, wMessage);
            str.Position = 0;
            var b = new byte[str.Length];

            str.Read(b, 0, (int)str.Length);
            return(b);
        }
Example #2
0
 public static byte[] Serialize(this WMessage src)
 {
     return(WMessage.Serialize(src));
 }