|Constructor and Description|
Creates a new decoder whose maximum object size is
Creates a new decoder with the specified maximum object size.
|Modifier and Type||Method and Description|
Decodes the received packets so far into a frame.
Extract a Frame of the specified buffer.
actualReadableBytes, afterAdd, afterRemove, appendToCumulation, beforeAdd, beforeRemove, channelClosed, channelDisconnected, cleanup, decodeLast, exceptionCaught, getMaxCumulationBufferCapacity, getMaxCumulationBufferComponents, internalBuffer, isUnfold, messageReceived, newCumulationBuffer, replace, setMaxCumulationBufferCapacity, setMaxCumulationBufferComponents, setUnfold, unfoldAndFireMessageReceived, updateCumulation
channelBound, channelConnected, channelInterestChanged, channelOpen, channelUnbound, childChannelClosed, childChannelOpen, handleUpstream, writeComplete
public MarshallingDecoder(UnmarshallerProvider provider)
1048576bytes. If the size of the received object is greater than
StreamCorruptedExceptionwill 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,
TooLongFrameExceptionwill be raised.
protected Object decode(ChannelHandlerContext ctx, Channel channel, ChannelBuffer buffer) throws Exception
FrameDecoder.extractFrame(ChannelBuffer, int, int)method, to make optimizations easier later.
ctx- the context of this handler
channel- the current channel
buffer- the cumulative buffer of received packets so far. Note that the buffer might be empty, which means you should not make an assumption that the buffer contains at least one byte in your decoder implementation.
nullif there's not enough data in the buffer to decode a frame.
protected ChannelBuffer extractFrame(ChannelBuffer buffer, int index, int length)
Copyright © 2008-2015 The Netty Project. All Rights Reserved.