Class BufferConversionHandler

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

    @Deprecated
    @Sharable
    public final class BufferConversionHandler
    extends Object
    implements io.netty5.channel.ChannelHandler
    Deprecated.
    This handler will be moved out of Netty core and into a contrib repository, before Netty 5.0.0.Final is released.
    ChannelHandler that converts ByteBuf messages into Buffer messages, and vice versa, depending on configuration.

    This class is useful as an intermediate handler that allows ByteBuf-based handlers and Buffer-based handlers to work together in the same pipeline.

    It is, however, recommended that all handlers eventually be converted to use the Buffer API, as that is more future-proof.

    Instances of this handler are ChannelHandler.Sharable and can be added to multiple pipelines. This is safe because the instances are immutable and thread-safe.

    • Method Detail

      • bufferToByteBuf

        public static BufferConversionHandler bufferToByteBuf()
        Deprecated.
        Create a conversion handler to insert after Buffer-reading handles, and before ByteBuf-reading handles. For writes, the handler will convert in the opposite direction.
        Returns:
        A conversion handler.
      • byteBufToBuffer

        public static BufferConversionHandler byteBufToBuffer()
        Deprecated.
        Create a conversion handler to insert after ByteBuf-reading handles, and before Buffer-reading handles. For writes, the handler will convert in the opposite direction.
        Returns:
        A conversion handler.
      • channelRead

        public void channelRead​(io.netty5.channel.ChannelHandlerContext ctx,
                                Object msg)
                         throws Exception
        Deprecated.
        Specified by:
        channelRead in interface io.netty5.channel.ChannelHandler
        Throws:
        Exception
      • userEventTriggered

        public void userEventTriggered​(io.netty5.channel.ChannelHandlerContext ctx,
                                       Object evt)
                                throws Exception
        Deprecated.
        Specified by:
        userEventTriggered in interface io.netty5.channel.ChannelHandler
        Throws:
        Exception
      • write

        public io.netty5.util.concurrent.Future<Void> write​(io.netty5.channel.ChannelHandlerContext ctx,
                                                            Object msg)
        Deprecated.
        Specified by:
        write in interface io.netty5.channel.ChannelHandler