Example usage for io.netty.handler.codec.compression JdkZlibEncoder JdkZlibEncoder

List of usage examples for io.netty.handler.codec.compression JdkZlibEncoder JdkZlibEncoder

Introduction

In this page you can find the example usage for io.netty.handler.codec.compression JdkZlibEncoder JdkZlibEncoder.

Prototype

public JdkZlibEncoder(byte[] dictionary) 

Source Link

Document

Creates a new zlib encoder with the default compression level ( 6 ) and the specified preset dictionary.

Usage

From source file:com.netflix.iep.http.ByteBufs.java

License:Apache License

/**
 * Map to a GZIP compressed sequence of ByteBuf.
 *//*ww w .  j  a v a2 s.co m*/
public static Observable.Transformer<ByteBuf, ByteBuf> gzip() {
    return input -> encode(input, new EmbeddedChannel(new JdkZlibEncoder(ZlibWrapper.GZIP)));
}