@ChannelHandler.Sharable public final class BrotliEncoder extends MessageToByteEncoder<io.netty.buffer.ByteBuf>
ByteBuf
with the brotli format.
See brotli.Constructor and Description |
---|
BrotliEncoder()
Create a new
BrotliEncoder Instance
with Encoder.Parameters#setQuality(int) set to 4
and Encoder.Parameters#setMode(Encoder.Mode) set to Encoder.Mode#TEXT |
BrotliEncoder(BrotliOptions brotliOptions)
Create a new
BrotliEncoder Instance |
BrotliEncoder(com.aayushatharva.brotli4j.encoder.Encoder.Parameters parameters)
Create a new
BrotliEncoder Instance |
Modifier and Type | Method and Description |
---|---|
protected io.netty.buffer.ByteBuf |
allocateBuffer(io.netty.channel.ChannelHandlerContext ctx,
io.netty.buffer.ByteBuf msg,
boolean preferDirect)
Allocate a
ByteBuf which will be used as argument of #encode(ChannelHandlerContext, I, ByteBuf) . |
protected void |
encode(io.netty.channel.ChannelHandlerContext ctx,
io.netty.buffer.ByteBuf msg,
io.netty.buffer.ByteBuf out)
Encode a message into a
ByteBuf . |
acceptOutboundMessage, isPreferDirect, write
bind, close, connect, deregister, disconnect, flush, read
ensureNotSharable, exceptionCaught, handlerAdded, handlerRemoved, isSharable
public BrotliEncoder()
BrotliEncoder
Instance
with Encoder.Parameters#setQuality(int)
set to 4
and Encoder.Parameters#setMode(Encoder.Mode)
set to Encoder.Mode#TEXT
public BrotliEncoder(com.aayushatharva.brotli4j.encoder.Encoder.Parameters parameters)
BrotliEncoder
Instanceparameters
- Encoder.Parameters
Instancepublic BrotliEncoder(BrotliOptions brotliOptions)
BrotliEncoder
InstancebrotliOptions
- BrotliOptions
to use.protected void encode(io.netty.channel.ChannelHandlerContext ctx, io.netty.buffer.ByteBuf msg, io.netty.buffer.ByteBuf out) throws Exception
MessageToByteEncoder
ByteBuf
. This method will be called for each written message that can be handled
by this encoder.encode
in class MessageToByteEncoder<io.netty.buffer.ByteBuf>
ctx
- the ChannelHandlerContext
which this MessageToByteEncoder
belongs tomsg
- the message to encodeout
- the ByteBuf
into which the encoded message will be writtenException
- is thrown if an error occursprotected io.netty.buffer.ByteBuf allocateBuffer(io.netty.channel.ChannelHandlerContext ctx, io.netty.buffer.ByteBuf msg, boolean preferDirect) throws Exception
MessageToByteEncoder
ByteBuf
which will be used as argument of #encode(ChannelHandlerContext, I, ByteBuf)
.
Sub-classes may override this method to return ByteBuf
with a perfect matching initialCapacity
.allocateBuffer
in class MessageToByteEncoder<io.netty.buffer.ByteBuf>
Exception
Copyright © 2008–2021 The Netty Project. All rights reserved.