Class MarshallingEncoder

  • All Implemented Interfaces:
    io.netty5.channel.ChannelHandler

    public class MarshallingEncoder
    extends io.netty5.handler.codec.MessageToByteEncoder<Object>
    MessageToByteEncoder implementation 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 every Object that gets serialized in front of the Object itself.

    Use this with MarshallingDecoder

    See JBoss Marshalling website for more information

    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      protected io.netty5.buffer.Buffer allocateBuffer​(io.netty5.channel.ChannelHandlerContext ctx, Object o)  
      protected void encode​(io.netty5.channel.ChannelHandlerContext ctx, Object msg, io.netty5.buffer.Buffer out)  
      boolean isSharable()  
      • Methods inherited from class io.netty5.handler.codec.MessageToByteEncoder

        acceptOutboundMessage, write
      • 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
    • Method Detail

      • allocateBuffer

        protected io.netty5.buffer.Buffer allocateBuffer​(io.netty5.channel.ChannelHandlerContext ctx,
                                                         Object o)
        Specified by:
        allocateBuffer in class io.netty5.handler.codec.MessageToByteEncoder<Object>
      • encode

        protected void encode​(io.netty5.channel.ChannelHandlerContext ctx,
                              Object msg,
                              io.netty5.buffer.Buffer out)
                       throws Exception
        Specified by:
        encode in class io.netty5.handler.codec.MessageToByteEncoder<Object>
        Throws:
        Exception
      • isSharable

        public boolean isSharable()