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

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

Introduction

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

Prototype

public JdkZlibDecoder() 

Source Link

Document

Creates a new instance with the default wrapper ( ZlibWrapper#ZLIB ).

Usage

From source file:org.apache.giraph.conf.ImmutableClassesGiraphConfiguration.java

License:Apache License

/**
 * Get decoder for message decompression in netty
 *
 * @return byte to message decoder//from   ww w.j  a v a2s  .co  m
 */
public ByteToMessageDecoder getNettyCompressionDecoder() {
    switch (GiraphConstants.NETTY_COMPRESSION_ALGORITHM.get(this)) {
    case "SNAPPY":
        return new SnappyFramedDecoder(true);
    case "INFLATE":
        return new JdkZlibDecoder();
    default:
        return null;
    }
}