@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. |
flushnewOutboundBufferafterAdd, afterRemove, beforeAdd, beforeRemove, bind, close, connect, deregister, disconnect, exceptionCaught, userEventTriggeredclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitbind, close, connect, deregister, disconnectafterAdd, afterRemove, beforeAdd, beforeRemove, exceptionCaught, userEventTriggeredpublic boolean isEncodable(Object msg) throws Exception
MessageToByteEncodertrue if and only if the specified message can be encoded by this encoder.isEncodable in class MessageToByteEncoder<Object>msg - the messageExceptionpublic void encode(ChannelHandlerContext ctx, Object msg, ByteBuf out) throws Exception
encode in class MessageToByteEncoder<Object>ExceptionCopyright © 2008-2012 The Netty Project. All Rights Reserved.