org.jboss.netty.handler.codec.compression
类 ZlibEncoder

java.lang.Object
  继承者 org.jboss.netty.handler.codec.oneone.OneToOneEncoder
      继承者 org.jboss.netty.handler.codec.compression.ZlibEncoder
所有已实现的接口:
ChannelDownstreamHandler, ChannelHandler, LifeCycleAwareChannelHandler

public class ZlibEncoder
extends OneToOneEncoder
implements LifeCycleAwareChannelHandler

Compresses a ChannelBuffer using the deflate algorithm.


嵌套类摘要
 
从接口 org.jboss.netty.channel.ChannelHandler 继承的嵌套类/接口
ChannelHandler.Sharable
 
构造方法摘要
ZlibEncoder()
          Creates a new zlib encoder with the default compression level (6) and the default wrapper (ZlibWrapper.ZLIB).
ZlibEncoder(byte[] dictionary)
          Creates a new zlib encoder with the default compression level (6) and the specified preset dictionary.
ZlibEncoder(int compressionLevel)
          Creates a new zlib encoder with the specified compressionLevel and the default wrapper (ZlibWrapper.ZLIB).
ZlibEncoder(int compressionLevel, byte[] dictionary)
          Creates a new zlib encoder with the specified compressionLevel and the specified preset dictionary.
ZlibEncoder(ZlibWrapper wrapper)
          Creates a new zlib encoder with the default compression level (6) and the specified wrapper.
ZlibEncoder(ZlibWrapper wrapper, int compressionLevel)
          Creates a new zlib encoder with the specified compressionLevel and the specified wrapper.
 
方法摘要
 void afterAdd(ChannelHandlerContext ctx)
           
 void afterRemove(ChannelHandlerContext ctx)
           
 void beforeAdd(ChannelHandlerContext ctx)
           
 void beforeRemove(ChannelHandlerContext ctx)
           
 ChannelFuture close()
           
 void handleDownstream(ChannelHandlerContext ctx, ChannelEvent evt)
          处理指定的下游事件.
 boolean isClosed()
           
 
从类 java.lang.Object 继承的方法
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

构造方法详细信息

ZlibEncoder

public ZlibEncoder()
Creates a new zlib encoder with the default compression level (6) and the default wrapper (ZlibWrapper.ZLIB).

抛出:
CompressionException - if failed to initialize zlib

ZlibEncoder

public ZlibEncoder(int compressionLevel)
Creates a new zlib encoder with the specified compressionLevel and the default wrapper (ZlibWrapper.ZLIB).

参数:
compressionLevel - 1 yields the fastest compression and 9 yields the best compression. 0 means no compression. The default compression level is 6.
抛出:
CompressionException - if failed to initialize zlib

ZlibEncoder

public ZlibEncoder(ZlibWrapper wrapper)
Creates a new zlib encoder with the default compression level (6) and the specified wrapper.

抛出:
CompressionException - if failed to initialize zlib

ZlibEncoder

public ZlibEncoder(ZlibWrapper wrapper,
                   int compressionLevel)
Creates a new zlib encoder with the specified compressionLevel and the specified wrapper.

参数:
compressionLevel - 1 yields the fastest compression and 9 yields the best compression. 0 means no compression. The default compression level is 6.
抛出:
CompressionException - if failed to initialize zlib

ZlibEncoder

public ZlibEncoder(byte[] dictionary)
Creates a new zlib encoder with the default compression level (6) and the specified preset dictionary. The wrapper is always ZlibWrapper.ZLIB because it is the only format that supports the preset dictionary.

参数:
dictionary - the preset dictionary
抛出:
CompressionException - if failed to initialize zlib

ZlibEncoder

public ZlibEncoder(int compressionLevel,
                   byte[] dictionary)
Creates a new zlib encoder with the specified compressionLevel and the specified preset dictionary. The wrapper is always ZlibWrapper.ZLIB because it is the only format that supports the preset dictionary.

参数:
compressionLevel - 1 yields the fastest compression and 9 yields the best compression. 0 means no compression. The default compression level is 6.
dictionary - the preset dictionary
抛出:
CompressionException - if failed to initialize zlib
方法详细信息

close

public ChannelFuture close()

isClosed

public boolean isClosed()

handleDownstream

public void handleDownstream(ChannelHandlerContext ctx,
                             ChannelEvent evt)
                      throws java.lang.Exception
从接口 ChannelDownstreamHandler 复制的描述
处理指定的下游事件.

指定者:
接口 ChannelDownstreamHandler 中的 handleDownstream
覆盖:
OneToOneEncoder 中的 handleDownstream
参数:
ctx - 处理器的上下文对象
evt - 要处理或拦截的事件
抛出:
java.lang.Exception

beforeAdd

public void beforeAdd(ChannelHandlerContext ctx)
               throws java.lang.Exception
指定者:
接口 LifeCycleAwareChannelHandler 中的 beforeAdd
抛出:
java.lang.Exception

afterAdd

public void afterAdd(ChannelHandlerContext ctx)
              throws java.lang.Exception
指定者:
接口 LifeCycleAwareChannelHandler 中的 afterAdd
抛出:
java.lang.Exception

beforeRemove

public void beforeRemove(ChannelHandlerContext ctx)
                  throws java.lang.Exception
指定者:
接口 LifeCycleAwareChannelHandler 中的 beforeRemove
抛出:
java.lang.Exception

afterRemove

public void afterRemove(ChannelHandlerContext ctx)
                 throws java.lang.Exception
指定者:
接口 LifeCycleAwareChannelHandler 中的 afterRemove
抛出:
java.lang.Exception