GeezerVison is showing netty.io — ObjectDecoder (Netty API Reference (4.1.141.Final))
Class ObjectDecoder
- All Implemented Interfaces:
ChannelHandler, ChannelInboundHandler
Deprecated.
This class has been deprecated with no replacement,
because serialization can be a security liability
A decoder which deserializes the received ByteBufs into Java
objects.
Please note that the serialized form this decoder expects is not
compatible with the standard ObjectOutputStream. Please use
ObjectEncoder or ObjectEncoderOutputStream to ensure the
interoperability with this decoder.
Security: serialization can be a security liability,
and should not be used without defining a list of classes that are
allowed to be desirialized. Such a list can be specified with the
jdk.serialFilter system property, for instance.
See the
serialization filtering article for more information.
-
-
-
Constructor Summary
Constructors
Constructor
Description
Deprecated.
Creates a new decoder with the specified maximum object size.
Deprecated.
Creates a new decoder whose maximum object size is 1048576
bytes.
-
Method Summary
Modifier and Type
Method
Description
Deprecated.
Create a frame out of the ByteBuf and return it.
decode, extractFrame, getUnadjustedFrameLength
Modifier and Type
Method
Description
protected final void
Decode the from one ByteBuf to an other.
Extract the sub-region of the specified buffer.
protected long
Decodes the specified region of the buffer into an unadjusted frame length.
actualReadableBytes, callDecode, channelInactive, channelRead, channelReadComplete, decodeLast, discardSomeReadBytes, handlerRemoved, handlerRemoved0, internalBuffer, isSingleDecode, setCumulator, setDiscardAfterReads, setSingleDecode, userEventTriggered
Modifier and Type
Method
Description
protected int
Returns the actual number of readable bytes in the internal cumulative
buffer of this decoder.
protected void
Called once data should be decoded from the given ByteBuf.
void
void
void
protected void
protected final void
final void
Do nothing by default, sub-classes may override this method.
protected void
Gets called after the ByteToMessageDecoder was removed from the actual context and it doesn't handle
events anymore.
Returns the internal cumulative buffer of this decoder.
boolean
void
void
void
void
Methods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Constructor Details
-
ObjectDecoder
Deprecated.
Creates a new decoder whose maximum object size is 1048576
bytes. If the size of the received object is greater than
1048576 bytes, a StreamCorruptedException will be
raised.
- Parameters:
classResolver - the ClassResolver to use for this decoder
-
ObjectDecoder
public ObjectDecoder(int maxObjectSize,
ClassResolver classResolver)
Deprecated.
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, StreamCorruptedException
will be raised.
classResolver - the ClassResolver which will load the class
of the serialized object
-
|