Class AbstractStreamBufferPool<B>

    • Constructor Detail

      • AbstractStreamBufferPool

        public AbstractStreamBufferPool()
    • Method Detail

      • getUnpooledStreamBuffer

        public StreamBuffer<B> getUnpooledStreamBuffer​(java.nio.ByteBuffer buffer)
        Description copied from interface: StreamBufferPool

        Obtains an StreamBuffer that is not pooled. This is for ByteBuffer instances that are managed outside the BufferPool.

        Typical use is to create StreamBuffer for some read-only cached content within a ByteBuffer.

        Specified by:
        getUnpooledStreamBuffer in interface StreamBufferPool<B>
        Parameters:
        buffer - ByteBuffer.
        Returns:
        StreamBuffer for the unpooled ByteBuffer.
      • getFileStreamBuffer

        public StreamBuffer<B> getFileStreamBuffer​(java.nio.channels.FileChannel file,
                                                   long position,
                                                   long count,
                                                   FileCompleteCallback callback)
        Description copied from interface: StreamBufferPool

        Obtains a StreamBuffer for the FileChannel content.

        This enables efficient writing (ie DMA) of FileChannel content.

        To write the entire FileChannel contents, invoke write(file, 0, -1).

        Note that the underlying implementation will need to support FileChannel efficiencies.

        Specified by:
        getFileStreamBuffer in interface StreamBufferPool<B>
        Parameters:
        file - FileChannel.
        position - Position within the FileChannel to start writing content. Must be non-negative number.
        count - Count of bytes to write from the FileChannel. A negative value (typically -1) indicates to write the remaining FileChannel content from the position.
        callback - Optional FileCompleteCallback. May be null.
        Returns:
        StreamBuffer for the FileChannel.