Search in sources :

Example 1 with RangeInputStream

use of org.h2.store.RangeInputStream in project h2database by h2database.

the class ValueLob method getInputStream.

@Override
public InputStream getInputStream(long oneBasedOffset, long length) {
    if (fileName == null) {
        return super.getInputStream(oneBasedOffset, length);
    }
    FileStore store = handler.openFile(fileName, "r", true);
    boolean alwaysClose = SysProperties.lobCloseBetweenReads;
    InputStream inputStream = new BufferedInputStream(new FileStoreInputStream(store, handler, compressed, alwaysClose), Constants.IO_BUFFER_SIZE);
    return rangeInputStream(inputStream, oneBasedOffset, length, store.length());
}
Also used : FileStore(org.h2.store.FileStore) BufferedInputStream(java.io.BufferedInputStream) FileStoreInputStream(org.h2.store.FileStoreInputStream) BufferedInputStream(java.io.BufferedInputStream) FileStoreInputStream(org.h2.store.FileStoreInputStream) RangeInputStream(org.h2.store.RangeInputStream) ByteArrayInputStream(java.io.ByteArrayInputStream) InputStream(java.io.InputStream)

Aggregations

BufferedInputStream (java.io.BufferedInputStream)1 ByteArrayInputStream (java.io.ByteArrayInputStream)1 InputStream (java.io.InputStream)1 FileStore (org.h2.store.FileStore)1 FileStoreInputStream (org.h2.store.FileStoreInputStream)1 RangeInputStream (org.h2.store.RangeInputStream)1