Package org.h2.store
Class RangeInputStream
- java.lang.Object
-
- java.io.InputStream
-
- java.io.FilterInputStream
-
- org.h2.store.RangeInputStream
-
- All Implemented Interfaces:
java.io.Closeable,java.lang.AutoCloseable
public final class RangeInputStream extends java.io.FilterInputStreamInput stream that reads only a specified range from the source stream.
-
-
Field Summary
Fields Modifier and Type Field Description private longlimit
-
Constructor Summary
Constructors Constructor Description RangeInputStream(java.io.InputStream in, long offset, long limit)Creates new instance of range input stream.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description intavailable()voidclose()voidmark(int readlimit)booleanmarkSupported()intread()intread(byte[] b, int off, int len)voidreset()longskip(long n)
-
-
-
Constructor Detail
-
RangeInputStream
public RangeInputStream(java.io.InputStream in, long offset, long limit) throws java.io.IOExceptionCreates new instance of range input stream.- Parameters:
in- source streamoffset- offset of the rangelimit- length of the range- Throws:
java.io.IOException- on I/O exception during seeking to the specified offset
-
-
Method Detail
-
read
public int read() throws java.io.IOException- Overrides:
readin classjava.io.FilterInputStream- Throws:
java.io.IOException
-
read
public int read(byte[] b, int off, int len) throws java.io.IOException- Overrides:
readin classjava.io.FilterInputStream- Throws:
java.io.IOException
-
skip
public long skip(long n) throws java.io.IOException- Overrides:
skipin classjava.io.FilterInputStream- Throws:
java.io.IOException
-
available
public int available() throws java.io.IOException- Overrides:
availablein classjava.io.FilterInputStream- Throws:
java.io.IOException
-
close
public void close() throws java.io.IOException- Specified by:
closein interfacejava.lang.AutoCloseable- Specified by:
closein interfacejava.io.Closeable- Overrides:
closein classjava.io.FilterInputStream- Throws:
java.io.IOException
-
mark
public void mark(int readlimit)
- Overrides:
markin classjava.io.FilterInputStream
-
reset
public void reset() throws java.io.IOException- Overrides:
resetin classjava.io.FilterInputStream- Throws:
java.io.IOException
-
markSupported
public boolean markSupported()
- Overrides:
markSupportedin classjava.io.FilterInputStream
-
-