public class PerMessageDeflateFunction extends Object implements ExtensionFunction
permessage-deflate WebSocket Extension.
This implementation supports parameters: server_no_context_takeover, client_no_context_takeover .
This implementation does not support parameters: server_max_window_bits, client_max_window_bits .
It uses the DEFLATE implementation algorithm packaged on Deflater and Inflater classes.| Modifier and Type | Field and Description |
|---|---|
static byte[] |
TAIL |
RSV1, RSV2, RSV3| Constructor and Description |
|---|
PerMessageDeflateFunction(int deflaterLevel,
boolean compressContextTakeover,
boolean decompressContextTakeover)
Create a new
PerMessageDeflateExtension instance. |
| Modifier and Type | Method and Description |
|---|---|
void |
dispose()
Dispose this function.
|
boolean |
hasExtensionOpCode()
Validate if current extension defines a new WebSocket Opcode.
|
PooledByteBuffer |
transformForRead(PooledByteBuffer pooledBuffer,
WebSocketChannel wsChannel,
boolean lastFragmentOfMessage)
Transform the supplied buffer per this extension.
|
PooledByteBuffer |
transformForWrite(PooledByteBuffer pooledBuffer,
WebSocketChannel wsChannel)
Transform the supplied buffer per this extension.
|
int |
writeRsv(int rsv)
Add RSV bits (RSV1, RSV2, RSV3) to the current rsv status.
|
public PerMessageDeflateFunction(int deflaterLevel,
boolean compressContextTakeover,
boolean decompressContextTakeover)
PerMessageDeflateExtension instance.deflaterLevel - the level of configuration of DEFLATE algorithm implementationcompressContextTakeover - flag for compressor context takeover or without compressor contextdecompressContextTakeover - flag for decompressor context takeover or without decompressor contextpublic int writeRsv(int rsv)
ExtensionFunctionwriteRsv in interface ExtensionFunctionrsv - current RSV bits statuspublic boolean hasExtensionOpCode()
ExtensionFunctionhasExtensionOpCode in interface ExtensionFunctiontrue if current extension defines specific Opcode
false is current extension does not define specific Opcodepublic PooledByteBuffer transformForWrite(PooledByteBuffer pooledBuffer, WebSocketChannel wsChannel) throws IOException
ExtensionFunctiontransformForWrite in interface ExtensionFunctionpooledBuffer - Buffer to transformwsChannel - working channelIOExceptionpublic PooledByteBuffer transformForRead(PooledByteBuffer pooledBuffer, WebSocketChannel wsChannel, boolean lastFragmentOfMessage) throws IOException
ExtensionFunctiontransformForRead in interface ExtensionFunctionpooledBuffer - Buffer to transformwsChannel - working channelIOExceptionpublic void dispose()
ExtensionFunctiondispose in interface ExtensionFunctionCopyright © 2016. All rights reserved.