class PerMessageDeflateEncoder extends DeflateEncoder
ChannelHandler.Sharable
Modifier and Type | Field and Description |
---|---|
private boolean |
compressing |
Constructor and Description |
---|
PerMessageDeflateEncoder(int compressionLevel,
int windowSize,
boolean noContext)
Constructor
|
Modifier and Type | Method and Description |
---|---|
boolean |
acceptOutboundMessage(java.lang.Object msg)
Returns
true if the given message should be handled. |
protected void |
encode(ChannelHandlerContext ctx,
WebSocketFrame msg,
java.util.List<java.lang.Object> out)
Encode from one message to an other.
|
protected boolean |
removeFrameTail(WebSocketFrame msg) |
protected int |
rsv(WebSocketFrame msg) |
handlerRemoved
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
public PerMessageDeflateEncoder(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.public boolean acceptOutboundMessage(java.lang.Object msg) throws java.lang.Exception
MessageToMessageEncoder
true
if the given message should be handled. If false
it will be passed to the next
ChannelOutboundHandler
in the ChannelPipeline
.acceptOutboundMessage
in class MessageToMessageEncoder<WebSocketFrame>
java.lang.Exception
protected int rsv(WebSocketFrame msg)
rsv
in class DeflateEncoder
msg
- the current frame.protected boolean removeFrameTail(WebSocketFrame msg)
removeFrameTail
in class DeflateEncoder
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 DeflateEncoder
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 occurs