private IEnumerable <Message> CreateGzipCompressedMessage(IEnumerable <Message> messages) { var messageSet = Message.EncodeMessageSet(messages); var gZipBytes = Compression.Zip(messageSet); var compressedMessage = new Message { Attribute = (byte)(0x00 | (ProtocolConstants.AttributeCodeMask & (byte)MessageCodec.CodecGzip)), Value = gZipBytes }; return(new[] { compressedMessage }); }
private CompressedMessageResult CreateGzipCompressedMessage(IEnumerable <Message> messages) { var messageSet = Message.EncodeMessageSet(messages); var gZipBytes = Compression.Zip(messageSet); var compressedMessage = new Message { Attribute = (byte)(0x00 | (ProtocolConstants.AttributeCodeMask & (byte)MessageCodec.CodecGzip)), Value = gZipBytes }; return(new CompressedMessageResult { CompressedAmount = messageSet.Length - compressedMessage.Value.Length, CompressedMessage = compressedMessage }); }