Top Description Inners Fields Constructors Methods
io.netty.handler.codec.compression

public final Class BrotliDecoder

extends ByteToMessageDecoder
Class Inheritance
Imports
com.aayushatharva.brotli4j.decoder.DecoderJNI, io.netty.buffer.ByteBuf, .ByteBufAllocator, io.netty.channel.ChannelHandlerContext, io.netty.handler.codec.ByteToMessageDecoder, io.netty.util.internal.ObjectUtil, java.nio.ByteBuffer, java.util.List

Decompresses a ByteBuf encoded with the brotli format. See brotli.

Nested and Inner Type Summary

Modifier and TypeClass and Description
private static enum

Field Summary

Modifier and TypeField and Description
private DecoderJNI.Wrapper
private boolean
private final int
Inherited from io.netty.handler.codec.ByteToMessageDecoder:
COMPOSITE_CUMULATORMERGE_CUMULATOR

Constructor Summary

AccessConstructor and Description
public
BrotliDecoder()

Creates a new BrotliDecoder with a default 8kB input buffer

public
BrotliDecoder(int
desired size of the input buffer in bytes
inputBufferSize
)

Creates a new BrotliDecoder

Method Summary

Modifier and TypeMethod and Description
public void
protected void
decode(ChannelHandlerContext ctx, ByteBuf
the ByteBuf from which to read data
in
,
List<Object>
the List to which decoded messages should be added
out
)

Implements abstract io.netty.handler.codec.ByteToMessageDecoder.decode.

Decode the from one ByteBuf to an other.
private BrotliDecoder.State
private void
public void
handlerAdded(ChannelHandlerContext ctx)

Overrides io.netty.channel.ChannelHandlerAdapter.handlerAdded.

Implements io.netty.channel.ChannelHandler.handlerAdded.

Gets called after the ChannelHandler was added to the actual context and it's ready to handle events.
protected void
handlerRemoved0(ChannelHandlerContext ctx)

Overrides io.netty.handler.codec.ByteToMessageDecoder.handlerRemoved0.

Gets called after the ByteToMessageDecoder was removed from the actual context and it doesn't handle events anymore.
private ByteBuf
private static int
Inherited from io.netty.handler.codec.ByteToMessageDecoder:
actualReadableBytescallDecodechannelReadchannelReadCompletedecodeLastdiscardSomeReadByteshandlerRemovedinternalBufferisSingleDecodesetCumulatorsetDiscardAfterReadssetSingleDecodeuserEventTriggered

Field Detail

decoderback to summary
private DecoderJNI.Wrapper decoder
destroyedback to summary
private boolean destroyed
inputBufferSizeback to summary
private final int inputBufferSize

Constructor Detail

BrotliDecoderback to summary
public BrotliDecoder()

Creates a new BrotliDecoder with a default 8kB input buffer

BrotliDecoderback to summary
public BrotliDecoder(int inputBufferSize)

Creates a new BrotliDecoder

Parameters
inputBufferSize:int

desired size of the input buffer in bytes

Method Detail

channelInactiveback to summary
public void channelInactive(ChannelHandlerContext ctx) throws Exception

Overrides io.netty.handler.codec.ByteToMessageDecoder.channelInactive.

Implements io.netty.channel.ChannelInboundHandler.channelInactive.

Doc from io.netty.channel.ChannelInboundHandlerAdapter.channelInactive.

Calls ChannelHandlerContext#fireChannelInactive() to forward to the next ChannelInboundHandler in the ChannelPipeline. Sub-classes may override this method to change behavior.

Annotations
@Override
decodeback to summary
protected void decode(ChannelHandlerContext ctx, ByteBuf in, List<Object> out) throws Exception

Implements abstract io.netty.handler.codec.ByteToMessageDecoder.decode.

Doc from io.netty.handler.codec.ByteToMessageDecoder.decode.

Decode the from one ByteBuf to an other. This method will be called till either the input ByteBuf has nothing to read when return from this method or till nothing was read from the input ByteBuf.

Parameters
ctx:ChannelHandlerContext

the ChannelHandlerContext which this ByteToMessageDecoder belongs to

in:ByteBuf

the ByteBuf from which to read data

out:List<Object>

the List to which decoded messages should be added

Annotations
@Override
Exceptions
Exception:
is thrown if an error occurs
decompressback to summary
private BrotliDecoder.State decompress(ByteBuf input, List<Object> output, ByteBufAllocator alloc)
destroyback to summary
private void destroy()
handlerAddedback to summary
public void handlerAdded(ChannelHandlerContext ctx) throws Exception

Overrides io.netty.channel.ChannelHandlerAdapter.handlerAdded.

Implements io.netty.channel.ChannelHandler.handlerAdded.

Doc from io.netty.channel.ChannelHandler.handlerAdded.

Gets called after the ChannelHandler was added to the actual context and it's ready to handle events.

Annotations
@Override
handlerRemoved0back to summary
protected void handlerRemoved0(ChannelHandlerContext ctx) throws Exception

Overrides io.netty.handler.codec.ByteToMessageDecoder.handlerRemoved0.

Doc from io.netty.handler.codec.ByteToMessageDecoder.handlerRemoved0.

Gets called after the ByteToMessageDecoder was removed from the actual context and it doesn't handle events anymore.

Annotations
@Override
pullback to summary
private ByteBuf pull(ByteBufAllocator alloc)
readBytesback to summary
private static int readBytes(ByteBuf in, ByteBuffer dest)
io.netty.handler.codec.compression back to summary

private final Enum BrotliDecoder.State

extends Enum<BrotliDecoder.State>
Class Inheritance

Field Summary

Modifier and TypeField and Description
public static final BrotliDecoder.State
public static final BrotliDecoder.State
public static final BrotliDecoder.State

Constructor Summary

AccessConstructor and Description
private

Method Summary

Modifier and TypeMethod and Description
public static BrotliDecoder.State
public static BrotliDecoder.State[]
Inherited from java.lang.Enum:
clonecompareTodescribeConstableequalsfinalizegetDeclaringClasshashCodenameordinaltoStringvalueOf

Field Detail

DONEback to summary
public static final BrotliDecoder.State DONE
ERRORback to summary
public static final BrotliDecoder.State ERROR
NEEDS_MORE_INPUTback to summary
public static final BrotliDecoder.State NEEDS_MORE_INPUT

Constructor Detail

Stateback to summary
private State()

Method Detail

valueOfback to summary
public static BrotliDecoder.State valueOf(String name)
valuesback to summary
public static BrotliDecoder.State[] values()