@ChannelHandler.Sharable public class ObjectEncoder extends MessageToByteEncoder<Object>
ByteBuf
.
Please note that the serialized form this encoder produces is not
compatible with the standard ObjectInputStream
. Please use
ObjectDecoder
or ObjectDecoderInputStream
to ensure the
interoperability with this encoder.
ChannelHandler.Sharable
Constructor and Description |
---|
ObjectEncoder() |
Modifier and Type | Method and Description |
---|---|
void |
encode(ChannelHandlerContext ctx,
Object msg,
ByteBuf out) |
boolean |
isEncodable(Object msg)
Returns
true if and only if the specified message can be encoded by this encoder. |
flush
newOutboundBuffer
afterAdd, afterRemove, beforeAdd, beforeRemove, bind, close, connect, deregister, disconnect, exceptionCaught, userEventTriggered
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
bind, close, connect, deregister, disconnect
afterAdd, afterRemove, beforeAdd, beforeRemove, exceptionCaught, userEventTriggered
public boolean isEncodable(Object msg) throws Exception
MessageToByteEncoder
true
if and only if the specified message can be encoded by this encoder.isEncodable
in class MessageToByteEncoder<Object>
msg
- the messageException
public void encode(ChannelHandlerContext ctx, Object msg, ByteBuf out) throws Exception
encode
in class MessageToByteEncoder<Object>
Exception
Copyright © 2008-2012 The Netty Project. All Rights Reserved.