Class MarshallingEncoder
- java.lang.Object
-
- io.netty5.channel.ChannelHandlerAdapter
-
- io.netty5.handler.codec.MessageToByteEncoder<Object>
-
- io.netty.contrib.handler.codec.marshalling.MarshallingEncoder
-
- All Implemented Interfaces:
io.netty5.channel.ChannelHandler
public class MarshallingEncoder extends io.netty5.handler.codec.MessageToByteEncoder<Object>
MessageToByteEncoderimplementation which uses JBoss Marshalling to marshal an Object. Be aware that this encoder is not compatible with another client that just use JBoss Marshalling as it includes the size of everyObjectthat gets serialized in front of theObjectitself.Use this with
MarshallingDecoderSee JBoss Marshalling website for more information
-
-
Constructor Summary
Constructors Constructor Description MarshallingEncoder(MarshallerProvider provider)Creates a new encoder.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected io.netty5.buffer.BufferallocateBuffer(io.netty5.channel.ChannelHandlerContext ctx, Object o)protected voidencode(io.netty5.channel.ChannelHandlerContext ctx, Object msg, io.netty5.buffer.Buffer out)booleanisSharable()-
Methods inherited from class io.netty5.handler.codec.MessageToByteEncoder
acceptOutboundMessage, write
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface io.netty5.channel.ChannelHandler
bind, channelActive, channelExceptionCaught, channelInactive, channelInboundEvent, channelRead, channelReadComplete, channelRegistered, channelShutdown, channelUnregistered, channelWritabilityChanged, close, connect, deregister, disconnect, flush, handlerAdded, handlerRemoved, pendingOutboundBytes, read, register, sendOutboundEvent, shutdown
-
-
-
-
Constructor Detail
-
MarshallingEncoder
public MarshallingEncoder(MarshallerProvider provider)
Creates a new encoder.- Parameters:
provider- theMarshallerProviderto use
-
-
Method Detail
-
allocateBuffer
protected io.netty5.buffer.Buffer allocateBuffer(io.netty5.channel.ChannelHandlerContext ctx, Object o)- Specified by:
allocateBufferin classio.netty5.handler.codec.MessageToByteEncoder<Object>
-
encode
protected void encode(io.netty5.channel.ChannelHandlerContext ctx, Object msg, io.netty5.buffer.Buffer out) throws Exception
-
isSharable
public boolean isSharable()
-
-