Deprecated
This class has been deprecated with no replacement, because serialization can be a security liability
ByteBuf
(interoperability version).
This encoder is interoperable with the standard Java object streams such as
ObjectInputStream and ObjectOutputStream.
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.
| Modifier and Type | Field and Description |
|---|---|
| private final int | |
| private int |
| Access | Constructor and Description |
|---|---|
| public | |
| public | CompatibleObjectEncoder(int
the number of objects between resetInterval)ObjectOutputStream#reset().
0 will disable resetting the stream, but the remote
peer will be at the risk of getting OutOfMemoryError in
the long term.Creates a new instance. |
| Modifier and Type | Method and Description |
|---|---|
| protected void | encode(ChannelHandlerContext
the ctx, Serializable ChannelHandlerContext which this MessageToByteEncoder belongs tothe message to encode msg, ByteBuf the out)ByteBuf into which the encoded message will be writtenImplements abstract io. ByteBuf.
|
| protected ObjectOutputStream | newObjectOutputStream(OutputStream out)
Creates a new |
| resetInterval | back to summary |
|---|---|
| private final int resetInterval | |
| writtenObjects | back to summary |
|---|---|
| private int writtenObjects | |
| CompatibleObjectEncoder | back to summary |
|---|---|
| public CompatibleObjectEncoder() Creates a new instance with the reset interval of | |
| CompatibleObjectEncoder | back to summary |
|---|---|
| public CompatibleObjectEncoder(int resetInterval) Creates a new instance.
| |
| encode | back to summary |
|---|---|
| protected void encode(ChannelHandlerContext ctx, Serializable msg, ByteBuf out) throws Exception Implements abstract io. Doc from io. Encode a message into a
| |
| newObjectOutputStream | back to summary |
|---|---|
| protected ObjectOutputStream newObjectOutputStream(OutputStream out) throws Exception Creates a new | |