Class InputStreamBufferInput

    • Constructor Detail

      • InputStreamBufferInput

        public InputStreamBufferInput​(java.io.InputStream in)
      • InputStreamBufferInput

        public InputStreamBufferInput​(java.io.InputStream in,
                                      int bufferSize)
    • Method Detail

      • newBufferInput

        public static MessageBufferInput newBufferInput​(java.io.InputStream in)
      • reset

        public java.io.InputStream reset​(java.io.InputStream in)
                                  throws java.io.IOException
        Reset Stream. This method doesn't close the old resource.
        Parameters:
        in - new stream
        Returns:
        the old resource
        Throws:
        java.io.IOException
      • next

        public MessageBuffer next()
                           throws java.io.IOException
        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.
        Throws:
        java.io.IOException - when IO error occurred when reading the data
      • close

        public void close()
                   throws java.io.IOException
        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
        Throws:
        java.io.IOException - when IO error occurred when closing the data source