public final class IgfsRangeInputStream extends IgfsInputStream
IgfsInputStream which streams only data within the given range.
This stream is used for IgfsInputStreamJobAdapter convenience adapter to create
jobs which will be working only with the assigned range. You can also use it explicitly when
working with IgfsJob directly.| Constructor and Description |
|---|
IgfsRangeInputStream(IgfsInputStream is,
IgfsFileRange range)
Constructor.
|
IgfsRangeInputStream(IgfsInputStream is,
long start,
long maxLen)
Constructor.
|
| Modifier and Type | Method and Description |
|---|---|
int |
available() |
void |
close() |
long |
length()
Gets file length during file open.
|
long |
position()
Get the current position in the input stream.
|
int |
read() |
int |
read(byte[] b,
int off,
int len) |
int |
read(long pos,
byte[] buf,
int off,
int len) |
void |
readFully(long pos,
byte[] buf)
Read bytes from the given position in the stream to the given buffer.
|
void |
readFully(long pos,
byte[] buf,
int off,
int len) |
void |
seek(long pos)
Seek to the specified position.
|
long |
startOffset()
Since range input stream represents a part of larger file stream, there is an offset at which this
range input stream starts in original input stream.
|
String |
toString() |
mark, markSupported, read, reset, skippublic IgfsRangeInputStream(IgfsInputStream is, long start, long maxLen) throws IOException
is - Base input stream.start - Start position.maxLen - Maximum stream length.IOException - In case of exception.public IgfsRangeInputStream(IgfsInputStream is, IgfsFileRange range) throws IOException
is - Base input stream.range - File range.IOException - In case of exception.public long length()
length in class IgfsInputStreampublic int read()
throws IOException
read in class InputStreamIOExceptionpublic int read(@NotNull
byte[] b,
int off,
int len)
throws IOException
read in class InputStreamIOExceptionpublic int read(long pos,
byte[] buf,
int off,
int len)
throws IOException
read in class IgfsInputStreampos - Position in the input stream to seek.buf - Buffer into which data is read.off - Offset in the buffer from which stream data should be written.len - The number of bytes to read.IOException - In case of IO exception.public void readFully(long pos,
byte[] buf)
throws IOException
readFully in class IgfsInputStreampos - Position in the input stream to seek.buf - Buffer into which data is read.IOException - In case of IO exception.public void readFully(long pos,
byte[] buf,
int off,
int len)
throws IOException
readFully in class IgfsInputStreampos - Position in the input stream to seek.buf - Buffer into which data is read.off - Offset in the buffer from which stream data should be written.len - The number of bytes to read.IOException - In case of IO exception.public void seek(long pos)
throws IOException
seek in class IgfsInputStreampos - Position to seek to.IOException - In case of IO exception.public long position()
position in class IgfsInputStreampublic long startOffset()
public int available()
available in class InputStreampublic void close()
throws IOException
close in interface Closeableclose in interface AutoCloseableclose in class InputStreamIOException
Follow @ApacheIgnite
Ignite Fabric : ver. 1.5.11 Release Date : April 8 2016