CompatibleObjectEncoder
, CompatibleObjectDecoder
,
ObjectInputStream
, and ObjectOutputStream
with
ObjectEncoder
, ObjectDecoder
,
ObjectEncoderOutputStream
, and
ObjectDecoderInputStream
respectively. This workaround
requires both a client and a server to be modified.@Deprecated public class CompatibleObjectDecoder extends ReplayingDecoder<org.jboss.netty.handler.codec.serialization.CompatibleObjectDecoderState>
ChannelBuffer
s into Java
objects (interoperability version).
This decoder is interoperable with the standard Java object
streams such as ObjectInputStream
and ObjectOutputStream
.
However, this decoder might perform worse than ObjectDecoder
if
the serialized object is big and complex. Also, it does not limit the
maximum size of the object, and consequently your application might face
the risk of DoS attack.
Please use ObjectEncoder
and ObjectDecoder
if you are not
required to keep the interoperability with the standard object streams.
ChannelHandler.Sharable
cumulation, DEFAULT_MAX_COMPOSITEBUFFER_COMPONENTS
Constructor and Description |
---|
CompatibleObjectDecoder()
Deprecated.
Creates a new decoder.
|
Modifier and Type | Method and Description |
---|---|
protected Object |
decode(ChannelHandlerContext ctx,
Channel channel,
ChannelBuffer buffer,
org.jboss.netty.handler.codec.serialization.CompatibleObjectDecoderState state)
Deprecated.
Decodes the received packets so far into a frame.
|
protected Object |
decodeLast(ChannelHandlerContext ctx,
Channel channel,
ChannelBuffer buffer,
org.jboss.netty.handler.codec.serialization.CompatibleObjectDecoderState state)
Deprecated.
Decodes the received data so far into a frame when the channel is
disconnected.
|
protected ObjectInputStream |
newObjectInputStream(InputStream in)
Deprecated.
Creates a new
ObjectInputStream which wraps the specified
InputStream . |
checkpoint, checkpoint, cleanup, decode, decodeLast, getState, internalBuffer, messageReceived, setState
actualReadableBytes, afterAdd, afterRemove, appendToCumulation, beforeAdd, beforeRemove, channelClosed, channelDisconnected, exceptionCaught, getMaxCumulationBufferCapacity, getMaxCumulationBufferComponents, isUnfold, newCumulationBuffer, replace, setMaxCumulationBufferCapacity, setMaxCumulationBufferComponents, setUnfold, unfoldAndFireMessageReceived, updateCumulation
channelBound, channelConnected, channelInterestChanged, channelOpen, channelUnbound, childChannelClosed, childChannelOpen, handleUpstream, writeComplete
public CompatibleObjectDecoder()
protected ObjectInputStream newObjectInputStream(InputStream in) throws Exception
ObjectInputStream
which wraps the specified
InputStream
. Override this method to use a subclass of the
ObjectInputStream
.Exception
protected Object decode(ChannelHandlerContext ctx, Channel channel, ChannelBuffer buffer, org.jboss.netty.handler.codec.serialization.CompatibleObjectDecoderState state) throws Exception
ReplayingDecoder
decode
in class ReplayingDecoder<org.jboss.netty.handler.codec.serialization.CompatibleObjectDecoderState>
ctx
- the context of this handlerchannel
- the current channelbuffer
- 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.state
- the current decoder state (null
if unused)Exception
protected Object decodeLast(ChannelHandlerContext ctx, Channel channel, ChannelBuffer buffer, org.jboss.netty.handler.codec.serialization.CompatibleObjectDecoderState state) throws Exception
ReplayingDecoder
decodeLast
in class ReplayingDecoder<org.jboss.netty.handler.codec.serialization.CompatibleObjectDecoderState>
ctx
- the context of this handlerchannel
- the current channelbuffer
- 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.state
- the current decoder state (null
if unused)Exception
Copyright © 2008-2013 The Netty Project. All Rights Reserved.