org.springframework.messaging.tcp.reactor

Class AbstractNioBufferReactorNettyCodec<P>

  • java.lang.Object
    • org.springframework.messaging.tcp.reactor.AbstractNioBufferReactorNettyCodec<P>
  • Type Parameters:
    P - the message payload type
    All Implemented Interfaces:
    ReactorNettyCodec<P>
    Direct Known Subclasses:
    StompReactorNettyCodec


    public abstract class AbstractNioBufferReactorNettyCodec<P>
    extends java.lang.Object
    implements ReactorNettyCodec<P>
    Convenient base class for ReactorNettyCodec implementations that need to work with NIO ByteBuffers.
    Since:
    5.0
    Author:
    Rossen Stoyanchev
    • Constructor Detail

      • AbstractNioBufferReactorNettyCodec

        public AbstractNioBufferReactorNettyCodec()
    • Method Detail

      • decode

        public java.util.Collection<Message<P>> decode(io.netty.buffer.ByteBuf inputBuffer)
        Description copied from interface: ReactorNettyCodec
        Decode the input ByteBuf into one or more Messages.
        Specified by:
        decode in interface ReactorNettyCodec<P>
        Parameters:
        inputBuffer - the input buffer to decode from
        Returns:
        0 or more decoded messages
      • encode

        public void encode(Message<P> message,
                           io.netty.buffer.ByteBuf outputBuffer)
        Description copied from interface: ReactorNettyCodec
        Encode the given Message to the output ByteBuf.
        Specified by:
        encode in interface ReactorNettyCodec<P>
        Parameters:
        message - the message to encode
        outputBuffer - the buffer to write to
      • decodeInternal

        protected abstract java.util.List<Message<P>> decodeInternal(java.nio.ByteBuffer nioBuffer)
      • encodeInternal

        protected abstract java.nio.ByteBuffer encodeInternal(Message<P> message)