Class MarshallingDecoder
- java.lang.Object
-
- io.netty5.channel.ChannelHandlerAdapter
-
- io.netty5.handler.codec.ByteToMessageDecoder
-
- io.netty5.handler.codec.LengthFieldBasedFrameDecoder
-
- io.netty.contrib.handler.codec.marshalling.MarshallingDecoder
-
- All Implemented Interfaces:
io.netty5.channel.ChannelHandler
public class MarshallingDecoder extends io.netty5.handler.codec.LengthFieldBasedFrameDecoderDecoder which MUST be used withMarshallingEncoder.A
LengthFieldBasedFrameDecoderwhich use anUnmarshallerto read the Object out of theBuffer.
-
-
Constructor Summary
Constructors Constructor Description MarshallingDecoder(UnmarshallerProvider provider)Creates a new decoder whose maximum object size is1048576bytes.MarshallingDecoder(UnmarshallerProvider provider, int maxObjectSize)Creates a new decoder with the specified maximum object size.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected Objectdecode0(io.netty5.channel.ChannelHandlerContext ctx, io.netty5.buffer.Buffer in)-
Methods inherited from class io.netty5.handler.codec.LengthFieldBasedFrameDecoder
decode, extractFrame, getUnadjustedFrameLength
-
Methods inherited from class io.netty5.handler.codec.ByteToMessageDecoder
actualReadableBytes, channelInactive, channelRead, channelReadComplete, channelShutdown, decodeLast, discardSomeReadBytes, handlerAdded, handlerAdded0, handlerRemoved, handlerRemoved0, internalBuffer, isSharable, isSingleDecode, setSingleDecode
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface io.netty5.channel.ChannelHandler
bind, channelActive, channelExceptionCaught, channelInboundEvent, channelRegistered, channelUnregistered, channelWritabilityChanged, close, connect, deregister, disconnect, flush, pendingOutboundBytes, read, register, sendOutboundEvent, shutdown, write
-
-
-
-
Constructor Detail
-
MarshallingDecoder
public MarshallingDecoder(UnmarshallerProvider provider)
Creates a new decoder whose maximum object size is1048576bytes. If the size of the received object is greater than1048576bytes, aStreamCorruptedExceptionwill be raised.
-
MarshallingDecoder
public MarshallingDecoder(UnmarshallerProvider provider, int maxObjectSize)
Creates a new decoder with the specified maximum object size.- Parameters:
maxObjectSize- the maximum byte length of the serialized object. if the length of the received object is greater than this value,TooLongFrameExceptionwill be raised.
-
-