public final class GridGgfsRangeInputStream extends GridGgfsInputStream
GridGgfsInputStream which streams only data within the given range.
This stream is used for GridGgfsInputStreamJobAdapter convenience adapter to create
jobs which will be working only with the assigned range. You can also use it explicitly when
working with GridGgfsJob directly.| Constructor and Description |
|---|
GridGgfsRangeInputStream(GridGgfsInputStream is,
GridGgfsFileRange range)
Constructor.
|
GridGgfsRangeInputStream(GridGgfsInputStream 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 GridGgfsRangeInputStream(GridGgfsInputStream is, long start, long maxLen) throws IOException
is - Base input stream.start - Start position.maxLen - Maximum stream length.IOException - In case of exception.public GridGgfsRangeInputStream(GridGgfsInputStream is, GridGgfsFileRange range) throws IOException
is - Base input stream.range - File range.IOException - In case of exception.public long length()
length in class GridGgfsInputStreampublic 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 GridGgfsInputStreampos - 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 GridGgfsInputStreampos - 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 GridGgfsInputStreampos - 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 GridGgfsInputStreampos - Position to seek to.IOException - In case of IO exception.public long position()
position in class GridGgfsInputStreampublic long startOffset()
public int available()
available in class InputStreampublic void close()
throws IOException
close in interface Closeableclose in interface AutoCloseableclose in class InputStreamIOExceptionCopyright © 2014. All rights reserved.