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 int
available()
void
close()
void
mark(int readlimit)
boolean
markSupported()
int
read()
int
read(byte[] b)
int
read(byte[] b, int off, int len)
void
reset()
long
skip(long n)
-
-
-
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:
available
in classInputStream
-
read
public int read() throws IOException
- Specified by:
read
in classInputStream
- Throws:
IOException
-
read
public int read(byte[] b) throws IOException
- Overrides:
read
in classInputStream
- Throws:
IOException
-
read
public int read(byte[] b, int off, int len) throws IOException
- Overrides:
read
in classInputStream
- Throws:
IOException
-
skip
public long skip(long n)
- Overrides:
skip
in classInputStream
-
mark
public void mark(int readlimit)
- Overrides:
mark
in classInputStream
-
reset
public void reset() throws IOException
- Overrides:
reset
in classInputStream
- Throws:
IOException
-
markSupported
public boolean markSupported()
- Overrides:
markSupported
in classInputStream
-
close
public void close()
- Specified by:
close
in interfaceAutoCloseable
- Specified by:
close
in interfaceCloseable
- Overrides:
close
in classInputStream
-
-