public static IReadableChannel CreateGZipCompressChannel(this ChannelFactory factory, IReadableChannel channel, CompressionLevel compressionLevel) { var deflater = new WritableDeflateChannel(compressionLevel, ZLibNative.GZip_DefaultWindowBits); return(factory.MakeReadableChannel(channel, deflater.Execute)); }