Пример #1
0
        public static byte[] PackMessage(Message message)
        {
            var serializedMessage = MessageSerializer.Serialize(message);
            var compressedMessage = ByteCompressor.Compress(serializedMessage);

            return(compressedMessage);
        }
Пример #2
0
        public static Message UnPackMessage(byte[] data)
        {
            var decompressData      = ByteCompressor.DeCompress(data);
            var deserializedMessage = MessageSerializer.DeSerialize(decompressData);

            return(deserializedMessage);
        }