public class MarshallingDecoder
extends io.netty.handler.codec.LengthFieldBasedFrameDecoder
MarshallingEncoder.
A LengthFieldBasedFrameDecoder which use an Unmarshaller to read the Object out
of the ByteBuf.| Constructor and Description |
|---|
MarshallingDecoder(UnmarshallerProvider provider)
Creates a new decoder whose maximum object size is
1048576
bytes. |
MarshallingDecoder(UnmarshallerProvider provider,
int maxObjectSize)
Creates a new decoder with the specified maximum object size.
|
| Modifier and Type | Method and Description |
|---|---|
protected Object |
decode(io.netty.channel.ChannelHandlerContext ctx,
io.netty.buffer.ByteBuf in) |
protected io.netty.buffer.ByteBuf |
extractFrame(io.netty.channel.ChannelHandlerContext ctx,
io.netty.buffer.ByteBuf buffer,
int index,
int length) |
decode, getUnadjustedFrameLengthactualReadableBytes, callDecode, channelInactive, channelRead, channelReadComplete, decodeLast, discardSomeReadBytes, handlerRemoved, handlerRemoved0, internalBuffer, isSingleDecode, setCumulator, setDiscardAfterReads, setSingleDecode, userEventTriggeredchannelActive, channelRegistered, channelUnregistered, channelWritabilityChanged, exceptionCaughtensureNotSharable, handlerAdded, isSharablepublic MarshallingDecoder(UnmarshallerProvider provider)
1048576
bytes. If the size of the received object is greater than
1048576 bytes, a StreamCorruptedException will be
raised.public MarshallingDecoder(UnmarshallerProvider provider, int maxObjectSize)
maxObjectSize - the maximum byte length of the serialized object.
if the length of the received object is greater
than this value, TooLongFrameException
will be raised.protected Object decode(io.netty.channel.ChannelHandlerContext ctx, io.netty.buffer.ByteBuf in) throws Exception
decode in class io.netty.handler.codec.LengthFieldBasedFrameDecoderExceptionprotected io.netty.buffer.ByteBuf extractFrame(io.netty.channel.ChannelHandlerContext ctx,
io.netty.buffer.ByteBuf buffer,
int index,
int length)
extractFrame in class io.netty.handler.codec.LengthFieldBasedFrameDecoderCopyright © 2008–2025 The Netty Project. All rights reserved.