Examples of EmbeddedByteChannel


Examples of io.netty.channel.embedded.EmbeddedByteChannel

*/
public class HttpContentDecompressor extends HttpContentDecoder {
    @Override
    protected EmbeddedByteChannel newContentDecoder(String contentEncoding) throws Exception {
        if ("gzip".equalsIgnoreCase(contentEncoding) || "x-gzip".equalsIgnoreCase(contentEncoding)) {
            return new EmbeddedByteChannel(ZlibCodecFactory.newZlibDecoder(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 EmbeddedByteChannel(ZlibCodecFactory.newZlibDecoder(ZlibWrapper.ZLIB_OR_NONE));
        }

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

Examples of io.netty.channel.embedded.EmbeddedByteChannel

            throw new Error();
        }

        return new Result(
                targetContentEncoding,
                new EmbeddedByteChannel(ZlibCodecFactory.newZlibEncoder(
                        wrapper, compressionLevel, windowBits, memLevel)));
    }
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.