Package org.apache.hadoop.io.file.tfile
Class BoundedRangeFileInputStream
java.lang.Object
java.io.InputStream
org.apache.hadoop.io.file.tfile.BoundedRangeFileInputStream
- All Implemented Interfaces:
Closeable,AutoCloseable
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
ConstructorsConstructorDescriptionBoundedRangeFileInputStream(FSDataInputStream in, long offset, long length) Constructor -
Method Summary
Methods inherited from class java.io.InputStream
nullInputStream, readAllBytes, readNBytes, readNBytes, skipNBytes, transferTo
-
Constructor Details
-
BoundedRangeFileInputStream
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 Details
-
available
- Overrides:
availablein classInputStream- Throws:
IOException
-
read
- Specified by:
readin classInputStream- Throws:
IOException
-
read
- Overrides:
readin classInputStream- Throws:
IOException
-
read
- Overrides:
readin classInputStream- Throws:
IOException
-
skip
- Overrides:
skipin classInputStream- Throws:
IOException
-
mark
public void mark(int readlimit) - Overrides:
markin classInputStream
-
reset
- 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
-