Class ByteBufferInput

    • Constructor Summary

      Constructors 
      Constructor Description
      ByteBufferInput​(java.nio.ByteBuffer input)  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void close()
      Closes the input.
      MessageBuffer next()
      Returns a next buffer to read.
      java.nio.ByteBuffer reset​(java.nio.ByteBuffer input)
      Reset buffer.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • ByteBufferInput

        public ByteBufferInput​(java.nio.ByteBuffer input)
    • Method Detail

      • reset

        public java.nio.ByteBuffer reset​(java.nio.ByteBuffer input)
        Reset buffer.
        Parameters:
        input - new buffer
        Returns:
        the old buffer
      • next

        public MessageBuffer next()
        Description copied from interface: MessageBufferInput
        Returns a next buffer to read.

        This method should return a MessageBuffer instance that has data filled in. When this method is called twice, the previously returned buffer is no longer used. Thus implementation of this method can safely discard it. This is useful when it uses a memory pool.

        Specified by:
        next in interface MessageBufferInput
        Returns:
        the next MessageBuffer, or return null if no more buffer is available.
      • close

        public void close()
        Description copied from interface: MessageBufferInput
        Closes the input.

        When this method is called, the buffer previously returned from MessageBufferInput.next() method is no longer used. Thus implementation of this method can safely discard it.

        If the input is already closed then invoking this method has no effect.

        Specified by:
        close in interface java.lang.AutoCloseable
        Specified by:
        close in interface java.io.Closeable
        Specified by:
        close in interface MessageBufferInput