Module org.sejda.io
Package org.sejda.io

Class BufferedSeekableSource

java.lang.Object
org.sejda.io.BufferedSeekableSource
All Implemented Interfaces:
Closeable, AutoCloseable, Channel, ReadableByteChannel, SeekableSource

public class BufferedSeekableSource extends Object implements SeekableSource
SeekableSource wrapping an existing one and providing buffered read. When a read method is called, a SeekableSources.INPUT_BUFFER_SIZE_PROPERTY long chunk of bytes is read from the underlying source and stored in memory. Subsequent reads are served from the in memory buffer until they fall outside its range, at that point a new buffer is read from the wrapped source.
Author:
Andrea Vacondio