@ChannelHandler.Sharable public class MarshallingEncoder extends MessageToByteEncoder<java.lang.Object>
MessageToByteEncoderimplementation which uses JBoss Marshalling to marshal an Object. Be aware that this encoder is not compatible with an other client that just use JBoss Marshalling as it includes the size of every
Objectthat gets serialized in front of the
Objectitself. Use this with
MarshallingDecoderSee JBoss Marshalling website for more information
|Constructor and Description|
Creates a new encoder.
|Modifier and Type||Method and Description|
Encode a message into a
acceptOutboundMessage, allocateBuffer, write
bind, close, connect, deregister, disconnect, flush, read
ensureNotSharable, exceptionCaught, handlerAdded, handlerRemoved, isSharable
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
protected void encode(ChannelHandlerContext ctx, java.lang.Object msg, ByteBuf out) throws java.lang.Exception
ByteBuf. This method will be called for each written message that can be handled by this encoder.
msg- the message to encode
ByteBufinto which the encoded message will be written
java.lang.Exception- is thrown if an error occurs
Copyright © 2008–2017 The Netty Project. All rights reserved.