public class CompatibleMarshallingDecoder extends io.netty.handler.codec.ReplayingDecoder<Void>
ReplayingDecoder which use an Unmarshaller to read the Object out of the ByteBuf.
If you can you should use MarshallingDecoder.| Modifier and Type | Field and Description |
|---|---|
protected int |
maxObjectSize |
protected UnmarshallerProvider |
provider |
| Constructor and Description |
|---|
CompatibleMarshallingDecoder(UnmarshallerProvider provider,
int maxObjectSize)
Create a new instance of
CompatibleMarshallingDecoder. |
| Modifier and Type | Method and Description |
|---|---|
protected void |
decode(io.netty.channel.ChannelHandlerContext ctx,
io.netty.buffer.ByteBuf buffer,
List<Object> out) |
protected void |
decodeLast(io.netty.channel.ChannelHandlerContext ctx,
io.netty.buffer.ByteBuf buffer,
List<Object> out) |
void |
exceptionCaught(io.netty.channel.ChannelHandlerContext ctx,
Throwable cause) |
callDecode, checkpoint, checkpoint, state, stateactualReadableBytes, channelInactive, channelRead, channelReadComplete, discardSomeReadBytes, handlerRemoved, handlerRemoved0, internalBuffer, isSingleDecode, setCumulator, setDiscardAfterReads, setSingleDecode, userEventTriggeredchannelActive, channelRegistered, channelUnregistered, channelWritabilityChangedensureNotSharable, handlerAdded, isSharableprotected final UnmarshallerProvider provider
protected final int maxObjectSize
public CompatibleMarshallingDecoder(UnmarshallerProvider provider, int maxObjectSize)
CompatibleMarshallingDecoder.provider - the UnmarshallerProvider which is used to obtain the Unmarshaller
for the ChannelmaxObjectSize - the maximal size (in bytes) of the Object to unmarshal. Once the size is
exceeded the Channel will get closed. Use a maxObjectSize of
Integer.MAX_VALUE to disable this. You should only do this if you are sure
that the received Objects will never be big and the sending side are trusted, as this
opens the possibility for a DOS-Attack due an OutOfMemoryError.protected void decode(io.netty.channel.ChannelHandlerContext ctx,
io.netty.buffer.ByteBuf buffer,
List<Object> out)
throws Exception
decode in class io.netty.handler.codec.ByteToMessageDecoderExceptionprotected void decodeLast(io.netty.channel.ChannelHandlerContext ctx,
io.netty.buffer.ByteBuf buffer,
List<Object> out)
throws Exception
decodeLast in class io.netty.handler.codec.ByteToMessageDecoderExceptionpublic void exceptionCaught(io.netty.channel.ChannelHandlerContext ctx,
Throwable cause)
throws Exception
exceptionCaught in interface io.netty.channel.ChannelHandlerexceptionCaught in interface io.netty.channel.ChannelInboundHandlerexceptionCaught in class io.netty.channel.ChannelInboundHandlerAdapterExceptionCopyright © 2008–2025 The Netty Project. All rights reserved.