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 |
|---|---|
| private final Deflater | |
| private final boolean | |
| private StreamSourceFrameChannel | |
| private final Inflater | |
| private final boolean | |
| private final int | |
| private static final byte[] |
| Access | Constructor and Description |
|---|---|
| public | PerMessageDeflateFunction(final int
the level of configuration of DEFLATE algorithm implementation deflaterLevel, boolean flag for compressor context takeover or without compressor context compressContextTakeover, boolean flag for decompressor context takeover or without decompressor context decompressContextTakeover)Create a new |
| Modifier and Type | Method and Description |
|---|---|
| private PooledByteBuffer | |
| private PooledByteBuffer | |
| public void | dispose()
Implements io. Dispose this function. |
| public boolean | hasExtensionOpCode()
Implements io. Validate if current extension defines a new WebSocket Opcode. |
| private PooledByteBuffer | |
| private PooledByteBuffer | |
| public synchronized PooledByteBuffer | transformForRead(PooledByteBuffer
Buffer to transform pooledBuffer, StreamSourceFrameChannel working channel channel, boolean If this frame is the last fragment of a message. Note that this may not be received for every message, if the message ends with an empty frame lastFragmentOfMessage)Implements io. Transform the supplied buffer per this extension. |
| public synchronized PooledByteBuffer | transformForWrite(PooledByteBuffer
Buffer to transform pooledBuffer, StreamSinkFrameChannel working channel channel, boolean lastFrame)Implements io. Transform the supplied buffer per this extension. |
| public int | writeRsv(int
current RSV bits status rsv)Implements io. Add RSV bits (RSV1, RSV2, RSV3) to the current rsv status. |
| compress | back to summary |
|---|---|
| private final Deflater compress | |
| compressContextTakeover | back to summary |
|---|---|
| private final boolean compressContextTakeover | |
| currentReadChannel | back to summary |
|---|---|
| private StreamSourceFrameChannel currentReadChannel | |
| decompress | back to summary |
|---|---|
| private final Inflater decompress | |
| decompressContextTakeover | back to summary |
|---|---|
| private final boolean decompressContextTakeover | |
| deflaterLevel | back to summary |
|---|---|
| private final int deflaterLevel | |
| TAIL | back to summary |
|---|---|
| private static final byte[] TAIL | |
| PerMessageDeflateFunction | back to summary |
|---|---|
| public PerMessageDeflateFunction(final int deflaterLevel, boolean compressContextTakeover, boolean decompressContextTakeover) Create a new
| |
| allocateBufferWithArray | back to summary |
|---|---|
| private PooledByteBuffer allocateBufferWithArray(WebSocketChannel channel, int size) | |
| decompress | back to summary |
|---|---|
| private PooledByteBuffer decompress(WebSocketChannel channel, PooledByteBuffer pooled) throws IOException | |
| dispose | back to summary |
|---|---|
| public void dispose() Implements io. Doc from io. Dispose this function. Called upon connection closure
| |
| hasExtensionOpCode | back to summary |
|---|---|
| public boolean hasExtensionOpCode() Implements io. Doc from io. Validate if current extension defines a new WebSocket Opcode.
| |
| largerBuffer | back to summary |
|---|---|
| private PooledByteBuffer largerBuffer(PooledByteBuffer smaller, WebSocketChannel channel, int newSize) | |
| toArrayBacked | back to summary |
|---|---|
| private PooledByteBuffer toArrayBacked(ByteBuffer buffer, ByteBufferPool pool) | |
| transformForRead | back to summary |
|---|---|
| public synchronized PooledByteBuffer transformForRead(PooledByteBuffer pooledBuffer, StreamSourceFrameChannel channel, boolean lastFragmentOfMessage) throws IOException Implements io. Doc from io. Transform the supplied buffer per this extension. The buffer can be modified in place, or a new pooled buffer can be returned (in which case be sure to free the original buffer
| |
| transformForWrite | back to summary |
|---|---|
| public synchronized PooledByteBuffer transformForWrite(PooledByteBuffer pooledBuffer, StreamSinkFrameChannel channel, boolean lastFrame) throws IOException Implements io. Doc from io. Transform the supplied buffer per this extension. The buffer can be modified in place, or a new pooled buffer can be returned (in which case be sure to free the original buffer
| |
| writeRsv | back to summary |
|---|---|
| public int writeRsv(int rsv) Implements io. Doc from io. Add RSV bits (RSV1, RSV2, RSV3) to the current rsv status.
| |