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(@NotNull 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, skip
public 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 IgfsInputStream
public int read() throws IOException
read
in class InputStream
IOException
public int read(@NotNull @NotNull byte[] b, int off, int len) throws IOException
read
in class InputStream
IOException
public int read(long pos, byte[] buf, int off, int len) throws IOException
read
in class IgfsInputStream
pos
- 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 IgfsInputStream
pos
- 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 IgfsInputStream
pos
- 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 IgfsInputStream
pos
- Position to seek to.IOException
- In case of IO exception.public long position()
position
in class IgfsInputStream
public long startOffset()
public int available()
available
in class InputStream
public void close() throws IOException
close
in interface Closeable
close
in interface AutoCloseable
close
in class InputStream
IOException
Follow @ApacheIgnite
Ignite Database and Caching Platform : ver. 2.7.2 Release Date : February 6 2019