public class BedrockBatchEncoder
extends io.netty.channel.ChannelOutboundHandlerAdapter
| Modifier and Type | Field and Description |
|---|---|
static java.lang.String |
NAME |
| Constructor and Description |
|---|
BedrockBatchEncoder() |
| Modifier and Type | Method and Description |
|---|---|
static void |
addPrefixed(io.netty.channel.ChannelHandlerContext ctx,
io.netty.buffer.CompositeByteBuf buf,
io.netty.buffer.ByteBuf message,
int reservedPrefixBytes)
Appends
message to buf behind its VarInt length. |
void |
flush(io.netty.channel.ChannelHandlerContext ctx) |
void |
handlerRemoved(io.netty.channel.ChannelHandlerContext ctx) |
void |
write(io.netty.channel.ChannelHandlerContext ctx,
java.lang.Object msg,
io.netty.channel.ChannelPromise promise) |
bind, close, connect, deregister, disconnect, readensureNotSharable, exceptionCaught, handlerAdded, isSharablepublic static final java.lang.String NAME
public void write(io.netty.channel.ChannelHandlerContext ctx,
java.lang.Object msg,
io.netty.channel.ChannelPromise promise)
throws java.lang.Exception
write in interface io.netty.channel.ChannelOutboundHandlerwrite in class io.netty.channel.ChannelOutboundHandlerAdapterjava.lang.Exceptionpublic void flush(io.netty.channel.ChannelHandlerContext ctx)
throws java.lang.Exception
flush in interface io.netty.channel.ChannelOutboundHandlerflush in class io.netty.channel.ChannelOutboundHandlerAdapterjava.lang.Exceptionpublic static void addPrefixed(io.netty.channel.ChannelHandlerContext ctx,
io.netty.buffer.CompositeByteBuf buf,
io.netty.buffer.ByteBuf message,
int reservedPrefixBytes)
message to buf behind its VarInt length.
When the encoder that produced the message reserved room ahead of it, the prefix is written into that gap and the whole thing goes in as a single component. Otherwise the prefix needs a buffer of its own, costing an allocation and a second component.
public void handlerRemoved(io.netty.channel.ChannelHandlerContext ctx)
throws java.lang.Exception
handlerRemoved in interface io.netty.channel.ChannelHandlerhandlerRemoved in class io.netty.channel.ChannelHandlerAdapterjava.lang.Exception