Class HintedReplayingDecoder<S>

  • All Implemented Interfaces:
    io.netty.channel.ChannelHandler, io.netty.channel.ChannelInboundHandler
    Direct Known Subclasses:
    HeaderDecoder

    public abstract class HintedReplayingDecoder<S>
    extends io.netty.handler.codec.ByteToMessageDecoder
    Copy-paste of ReplayingDecoder which is hinted to not attempt decoding unless enough bytes are read. The decoder does not expect pass different message up the pipeline, this is a terminal read operation.
    • Nested Class Summary

      • Nested classes/interfaces inherited from class io.netty.handler.codec.ByteToMessageDecoder

        io.netty.handler.codec.ByteToMessageDecoder.Cumulator
      • Nested classes/interfaces inherited from interface io.netty.channel.ChannelHandler

        io.netty.channel.ChannelHandler.Sharable
    • Field Summary

      • Fields inherited from class io.netty.handler.codec.ByteToMessageDecoder

        COMPOSITE_CUMULATOR, MERGE_CUMULATOR
    • Constructor Summary

      Constructors 
      Modifier Constructor Description
      protected HintedReplayingDecoder()
      Creates a new instance with no initial state (i.e: null).
      protected HintedReplayingDecoder​(S initialState)
      Creates a new instance with the specified initial state.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      protected void callDecode​(io.netty.channel.ChannelHandlerContext ctx, io.netty.buffer.ByteBuf in, List<Object> xxx)  
      void channelInactive​(io.netty.channel.ChannelHandlerContext ctx)  
      protected void checkpoint()
      Stores the internal cumulative buffer's reader position.
      protected void checkpoint​(S state)
      Stores the internal cumulative buffer's reader position and updates the current decoder state.
      protected S state()
      Returns the current state of this decoder.
      protected S state​(S newState)
      Sets the current state of this decoder.
      • Methods inherited from class io.netty.handler.codec.ByteToMessageDecoder

        actualReadableBytes, channelRead, channelReadComplete, decode, decodeLast, discardSomeReadBytes, handlerRemoved, handlerRemoved0, internalBuffer, isSingleDecode, setCumulator, setDiscardAfterReads, setSingleDecode, userEventTriggered
      • Methods inherited from class io.netty.channel.ChannelInboundHandlerAdapter

        channelActive, channelRegistered, channelUnregistered, channelWritabilityChanged, exceptionCaught
      • Methods inherited from class io.netty.channel.ChannelHandlerAdapter

        ensureNotSharable, handlerAdded, isSharable
      • Methods inherited from interface io.netty.channel.ChannelHandler

        handlerAdded
    • Constructor Detail

      • HintedReplayingDecoder

        protected HintedReplayingDecoder()
        Creates a new instance with no initial state (i.e: null).
      • HintedReplayingDecoder

        protected HintedReplayingDecoder​(S initialState)
        Creates a new instance with the specified initial state.
    • Method Detail

      • checkpoint

        protected void checkpoint()
        Stores the internal cumulative buffer's reader position.
      • checkpoint

        protected void checkpoint​(S state)
        Stores the internal cumulative buffer's reader position and updates the current decoder state.
      • state

        protected S state()
        Returns the current state of this decoder.
        Returns:
        the current state of this decoder
      • state

        protected S state​(S newState)
        Sets the current state of this decoder.
        Returns:
        the old state of this decoder
      • channelInactive

        public void channelInactive​(io.netty.channel.ChannelHandlerContext ctx)
                             throws Exception
        Specified by:
        channelInactive in interface io.netty.channel.ChannelInboundHandler
        Overrides:
        channelInactive in class io.netty.handler.codec.ByteToMessageDecoder
        Throws:
        Exception
      • callDecode

        protected void callDecode​(io.netty.channel.ChannelHandlerContext ctx,
                                  io.netty.buffer.ByteBuf in,
                                  List<Object> xxx)
        Overrides:
        callDecode in class io.netty.handler.codec.ByteToMessageDecoder