Examples of ZlibDecoder


Examples of com.facebook.presto.jdbc.internal.netty.handler.codec.compression.ZlibDecoder

*/
public class HttpContentDecompressor extends HttpContentDecoder {
    @Override
    protected DecoderEmbedder<ChannelBuffer> newContentDecoder(String contentEncoding) throws Exception {
        if ("gzip".equalsIgnoreCase(contentEncoding) || "x-gzip".equalsIgnoreCase(contentEncoding)) {
            return new DecoderEmbedder<ChannelBuffer>(new ZlibDecoder(ZlibWrapper.GZIP));
        }
        if ("deflate".equalsIgnoreCase(contentEncoding) || "x-deflate".equalsIgnoreCase(contentEncoding)) {
            // To be strict, 'deflate' means ZLIB, but some servers were not implemented correctly.
            return new DecoderEmbedder<ChannelBuffer>(new ZlibDecoder(ZlibWrapper.ZLIB_OR_NONE));
        }

        // 'identity' or unsupported
        return null;
    }
View Full Code Here

Examples of io.netty.handler.codec.compression.ZlibDecoder

    public ChannelPipeline getPipeline() throws Exception {
        ChannelPipeline pipeline = pipeline();

        // Enable stream compression (you can remove these two if unnecessary)
        pipeline.addLast("deflater", new ZlibEncoder(ZlibWrapper.GZIP));
        pipeline.addLast("inflater", new ZlibDecoder(ZlibWrapper.GZIP));

        // Add the number codec first,
        pipeline.addLast("decoder", new BigIntegerDecoder());
        pipeline.addLast("encoder", new NumberEncoder());
View Full Code Here

Examples of io.netty.handler.codec.compression.ZlibDecoder

    public ChannelPipeline getPipeline() throws Exception {
        ChannelPipeline pipeline = pipeline();

        // Enable stream compression (you can remove these two if unnecessary)
        pipeline.addLast("deflater", new ZlibEncoder(ZlibWrapper.GZIP));
        pipeline.addLast("inflater", new ZlibDecoder(ZlibWrapper.GZIP));

        // Add the number codec first,
        pipeline.addLast("decoder", new BigIntegerDecoder());
        pipeline.addLast("encoder", new NumberEncoder());
View Full Code Here

Examples of io.netty.handler.codec.compression.ZlibDecoder

    }

    private void enableGzip(ChannelHandlerContext ctx) {
        ChannelPipeline p = ctx.getPipeline();
        p.addLast("gzipdeflater", new ZlibEncoder(ZlibWrapper.GZIP));
        p.addLast("gzipinflater", new ZlibDecoder(ZlibWrapper.GZIP));
        p.addLast("unificationB", new PortUnificationServerHandler(detectSsl, false));
        p.remove(this);
    }
View Full Code Here

Examples of io.netty.handler.codec.compression.ZlibDecoder

*/
public class HttpContentDecompressor extends HttpContentDecoder {
    @Override
    protected DecoderEmbedder<ChannelBuffer> newContentDecoder(String contentEncoding) throws Exception {
        if ("gzip".equalsIgnoreCase(contentEncoding) || "x-gzip".equalsIgnoreCase(contentEncoding)) {
            return new DecoderEmbedder<ChannelBuffer>(new ZlibDecoder(ZlibWrapper.GZIP));
        } else if ("deflate".equalsIgnoreCase(contentEncoding) || "x-deflate".equalsIgnoreCase(contentEncoding)) {
            // To be strict, 'deflate' means ZLIB, but some servers were not implemented correctly.
            return new DecoderEmbedder<ChannelBuffer>(new ZlibDecoder(ZlibWrapper.ZLIB_OR_NONE));
        }

        // 'identity' or unsupported
        return null;
    }
View Full Code Here

Examples of org.jboss.netty.handler.codec.compression.ZlibDecoder

    public ChannelPipeline getPipeline() throws Exception {
        ChannelPipeline pipeline = pipeline();

        // Enable stream compression (you can remove these two if unnecessary)
        pipeline.addLast("deflater", new ZlibEncoder(ZlibWrapper.GZIP));
        pipeline.addLast("inflater", new ZlibDecoder(ZlibWrapper.GZIP));

        // Add the number codec first,
        pipeline.addLast("decoder", new BigIntegerDecoder());
        pipeline.addLast("encoder", new NumberEncoder());
View Full Code Here

Examples of org.jboss.netty.handler.codec.compression.ZlibDecoder

      TrustManager[] managers;
      try {
        if (enableCompression) {
          ZlibEncoder encoder = new ZlibEncoder(compressionLevel);
          pipeline.addFirst("deflater", encoder);
          pipeline.addFirst("inflater", new ZlibDecoder());
        }
        if (enableSsl) {
          if (trustAllCerts) {
            logger.warn("No truststore configured, setting TrustManager to accept"
                + " all server certificates");
View Full Code Here

Examples of org.jboss.netty.handler.codec.compression.ZlibDecoder

    public SocketChannel newChannel(ChannelPipeline pipeline) {
      try {

        ZlibEncoder encoder = new ZlibEncoder(compressionLevel);
        pipeline.addFirst("deflater", encoder);
        pipeline.addFirst("inflater", new ZlibDecoder());
        return super.newChannel(pipeline);
      } catch (Exception ex) {
        throw new RuntimeException("Cannot create Compression channel", ex);
      }
    }
View Full Code Here

Examples of org.jboss.netty.handler.codec.compression.ZlibDecoder

    public ChannelPipeline getPipeline() throws Exception {
      ChannelPipeline pipeline = Channels.pipeline();
      if (enableCompression) {
        ZlibEncoder encoder = new ZlibEncoder(6);
        pipeline.addFirst("deflater", encoder);
        pipeline.addFirst("inflater", new ZlibDecoder());
      }


      if (enableSsl) {
        SSLEngine sslEngine = createServerSSLContext().createSSLEngine();
View Full Code Here

Examples of org.jboss.netty.handler.codec.compression.ZlibDecoder

      ChannelHandler ch = null;
      while((ch = pipeline.getFirst())!=null) {
          pipeline.remove(ch);
      }     
      if(gzip) {
        pipeline.addLast("decompressor", new ZlibDecoder(ZlibWrapper.GZIP));
      }
      List<ChannelBuffer> delims = new ArrayList<ChannelBuffer>();
      delims.add(SEMICOL_DELIM);
      pipeline.addLast("frameDecoder", new DelimiterBasedFrameDecoder(65536, true, true, delims.toArray(new ChannelBuffer[delims.size()])));
      //pipeline.addLast("logger", new LoggingHandler(InternalLogLevel.INFO));
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.