|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.jboss.netty.handler.codec.oneone.OneToOneEncoder
org.jboss.netty.handler.codec.compression.ZlibEncoder
public class ZlibEncoder
Compresses a ChannelBuffer using the deflate algorithm.
| Nested Class Summary |
|---|
| Nested classes/interfaces inherited from interface org.jboss.netty.channel.ChannelHandler |
|---|
ChannelHandler.Sharable |
| Constructor Summary | |
|---|---|
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. |
|
| Method Summary | |
|---|---|
void |
afterAdd(ChannelHandlerContext ctx)
|
void |
afterRemove(ChannelHandlerContext ctx)
|
void |
beforeAdd(ChannelHandlerContext ctx)
|
void |
beforeRemove(ChannelHandlerContext ctx)
|
ChannelFuture |
close()
|
protected Object |
encode(ChannelHandlerContext ctx,
Channel channel,
Object msg)
Transforms the specified message into another message and return the transformed message. |
void |
handleDownstream(ChannelHandlerContext ctx,
ChannelEvent evt)
Handles the specified downstream event. |
boolean |
isClosed()
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public ZlibEncoder()
6)
and the default wrapper (ZlibWrapper.ZLIB).
CompressionException - if failed to initialize zlibpublic ZlibEncoder(int compressionLevel)
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 zlibpublic ZlibEncoder(ZlibWrapper wrapper)
6)
and the specified wrapper.
CompressionException - if failed to initialize zlib
public ZlibEncoder(ZlibWrapper wrapper,
int compressionLevel)
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 zlibpublic ZlibEncoder(byte[] dictionary)
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
public ZlibEncoder(int compressionLevel,
byte[] dictionary)
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| Method Detail |
|---|
public ChannelFuture close()
public boolean isClosed()
protected Object encode(ChannelHandlerContext ctx,
Channel channel,
Object msg)
throws Exception
OneToOneEncodernull, unlike
you can in OneToOneDecoder.decode(ChannelHandlerContext, Channel, Object);
you must return something, at least ChannelBuffers.EMPTY_BUFFER.
encode in class OneToOneEncoderException
public void handleDownstream(ChannelHandlerContext ctx,
ChannelEvent evt)
throws Exception
ChannelDownstreamHandler
handleDownstream in interface ChannelDownstreamHandlerhandleDownstream in class OneToOneEncoderctx - the context object for this handlerevt - the downstream event to process or intercept
Exception
public void beforeAdd(ChannelHandlerContext ctx)
throws Exception
beforeAdd in interface LifeCycleAwareChannelHandlerException
public void afterAdd(ChannelHandlerContext ctx)
throws Exception
afterAdd in interface LifeCycleAwareChannelHandlerException
public void beforeRemove(ChannelHandlerContext ctx)
throws Exception
beforeRemove in interface LifeCycleAwareChannelHandlerException
public void afterRemove(ChannelHandlerContext ctx)
throws Exception
afterRemove in interface LifeCycleAwareChannelHandlerException
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||