Example usage for io.netty.handler.codec.http HttpContentCompressor HttpContentCompressor

List of usage examples for io.netty.handler.codec.http HttpContentCompressor HttpContentCompressor

Introduction

In this page you can find the example usage for io.netty.handler.codec.http HttpContentCompressor HttpContentCompressor.

Prototype

public HttpContentCompressor(int compressionLevel, int windowBits, int memLevel) 

Source Link

Document

Creates a new handler with the specified compression level, window size, and memory level..

Usage

From source file:de.cubeisland.engine.core.webapi.ApiServerInitializer.java

License:Open Source License

@Override
public void initChannel(SocketChannel ch) throws Exception {
    ch.pipeline().addLast("ipfilter", new IpFilter(server))
            .addLast("iplimiter", new IpLimiter(server.getMaxConnectionCount()))
            .addLast("decoder", new HttpRequestDecoder())
            .addLast("aggregator", new HttpObjectAggregator(this.server.getMaxContentLength()))
            .addLast("encoder", new HttpResponseEncoder())
            .addLast("httpHandler", new HttpRequestHandler(core, this.server, this.objectMapper));
    if (this.server.isCompressionEnabled()) {
        ch.pipeline().addLast("deflater", new HttpContentCompressor(this.server.getCompressionLevel(),
                this.server.getCompressionWindowBits(), this.server.getCompressionMemoryLevel()));
    }/*from   w ww.  j a  v  a 2  s.co m*/
}