abstract class DeflateEncoder extends WebSocketExtensionEncoder
ChannelHandler.Sharable
Modifier and Type | Field and Description |
---|---|
private int |
compressionLevel |
private EmbeddedChannel |
encoder |
private boolean |
noContext |
private int |
windowSize |
Constructor and Description |
---|
DeflateEncoder(int compressionLevel,
int windowSize,
boolean noContext)
Constructor
|
Modifier and Type | Method and Description |
---|---|
private void |
cleanup() |
protected void |
encode(ChannelHandlerContext ctx,
WebSocketFrame msg,
java.util.List<java.lang.Object> out)
Encode from one message to an other.
|
void |
handlerRemoved(ChannelHandlerContext ctx)
Do nothing by default, sub-classes may override this method.
|
protected abstract boolean |
removeFrameTail(WebSocketFrame msg) |
protected abstract int |
rsv(WebSocketFrame msg) |
acceptOutboundMessage, write
bind, close, connect, deregister, disconnect, flush, read
ensureNotSharable, exceptionCaught, handlerAdded, isSharable
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
exceptionCaught, handlerAdded
private final int compressionLevel
private final int windowSize
private final boolean noContext
private EmbeddedChannel encoder
public DeflateEncoder(int compressionLevel, int windowSize, boolean noContext)
compressionLevel
- compression level of the compressor.windowSize
- maximum size of the window compressor buffer.noContext
- true to disable context takeover.protected abstract int rsv(WebSocketFrame msg)
msg
- the current frame.protected abstract boolean removeFrameTail(WebSocketFrame msg)
msg
- the current frame.protected void encode(ChannelHandlerContext ctx, WebSocketFrame msg, java.util.List<java.lang.Object> out) throws java.lang.Exception
MessageToMessageEncoder
encode
in class MessageToMessageEncoder<WebSocketFrame>
ctx
- the ChannelHandlerContext
which this MessageToMessageEncoder
belongs tomsg
- the message to encode to an other oneout
- the List
into which the encoded msg should be added
needs to do some kind of aggregationjava.lang.Exception
- is thrown if an error occurspublic void handlerRemoved(ChannelHandlerContext ctx) throws java.lang.Exception
ChannelHandlerAdapter
handlerRemoved
in interface ChannelHandler
handlerRemoved
in class ChannelHandlerAdapter
java.lang.Exception
private void cleanup()