Class BoundedRangeFileInputStream
- java.lang.Object
-
- java.io.InputStream
-
- org.apache.accumulo.core.file.streams.BoundedRangeFileInputStream
-
- All Implemented Interfaces:
Closeable,AutoCloseable
public class BoundedRangeFileInputStream extends InputStream
BoundedRangeFIleInputStream abstracts a contiguous region of a Hadoop FSDataInputStream as a regular input stream. One can create multiple BoundedRangeFileInputStream on top of the same FSDataInputStream and they would not interfere with each other.
-
-
Constructor Summary
Constructors Constructor Description BoundedRangeFileInputStream(StreamType in, long offset, long length)Constructor
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description intavailable()voidclose()voidmark(int readlimit)booleanmarkSupported()intread()intread(byte[] b)intread(byte[] b, int off, int len)voidreset()longskip(long n)-
Methods inherited from class java.io.InputStream
nullInputStream, readAllBytes, readNBytes, readNBytes, transferTo
-
-
-
-
Constructor Detail
-
BoundedRangeFileInputStream
public BoundedRangeFileInputStream(StreamType in, long offset, long length)Constructor- Parameters:
in- The FSDataInputStream we connect to.offset- Beginning offset of the region.length- Length of the region. The actual length of the region may be smaller if (off_begin + length) goes beyond the end of FS input stream.
-
-
Method Detail
-
available
public int available()
- Overrides:
availablein classInputStream
-
read
public int read() throws IOException- Specified by:
readin classInputStream- Throws:
IOException
-
read
public int read(byte[] b) throws IOException- Overrides:
readin classInputStream- Throws:
IOException
-
read
public int read(byte[] b, int off, int len) throws IOException- Overrides:
readin classInputStream- Throws:
IOException
-
skip
public long skip(long n)
- Overrides:
skipin classInputStream
-
mark
public void mark(int readlimit)
- Overrides:
markin classInputStream
-
reset
public void reset() throws IOException- Overrides:
resetin classInputStream- Throws:
IOException
-
markSupported
public boolean markSupported()
- Overrides:
markSupportedin classInputStream
-
close
public void close()
- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable- Overrides:
closein classInputStream
-
-