List of usage examples for io.netty.handler.codec.http HttpContentCompressor HttpContentCompressor
public HttpContentCompressor(int compressionLevel, int windowBits, int memLevel)
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*/ }