Class ByteBufferInputStream

  • All Implemented Interfaces:
    Closeable, AutoCloseable

    public final class ByteBufferInputStream
    extends InputStream
    This class is a customized input stream implementation which reads data from list of ByteBuffer. If the ByteBuffer is direct, it may reside outside the normal garbage-collected heap memory.
    • Constructor Detail

      • ByteBufferInputStream

        public ByteBufferInputStream​(List<ByteBuffer> bufList)
        Default Constructor.
        bufList - is the target data to read.
    • Method Detail

      • getBuffer

        public ByteBuffer getBuffer()
                             throws IOException
        Return next non-empty @code{ByteBuffer}.
        ByteBuffer to write the data.
        IOException - when fail to retrieve buffer.