RandomAccessSourcepublic class WindowRandomAccessSource extends java.lang.Object implements RandomAccessSource
| Constructor | Description |
|---|---|
WindowRandomAccessSource(RandomAccessSource source,
long offset) |
Constructs a new OffsetRandomAccessSource that extends to the end of the underlying source
|
WindowRandomAccessSource(RandomAccessSource source,
long offset,
long length) |
Constructs a new OffsetRandomAccessSource with an explicit length
|
| Modifier and Type | Method | Description |
|---|---|---|
void |
close() |
Closes this source.
|
int |
get(long position) |
Gets a byte at the specified position
|
int |
get(long position,
byte[] bytes,
int off,
int len) |
Gets an array at the specified position.
|
long |
length() |
Note that the length will be adjusted to read from the corrected location in the underlying source
|
public WindowRandomAccessSource(RandomAccessSource source, long offset)
source - the sourceoffset - the amount of the offset to usepublic WindowRandomAccessSource(RandomAccessSource source, long offset, long length)
source - the sourceoffset - the amount of the offset to uselength - the number of bytes to be included in this RASpublic int get(long position)
throws java.io.IOException
get in interface RandomAccessSourcejava.io.IOExceptionpublic int get(long position,
byte[] bytes,
int off,
int len)
throws java.io.IOException
get in interface RandomAccessSourceposition - the position in the RandomAccessSource to read frombytes - output bufferoff - offset into the output buffer where results will be placedlen - the number of bytes to readjava.io.IOExceptionpublic long length()
length in interface RandomAccessSourcepublic void close()
throws java.io.IOException
close in interface RandomAccessSourcejava.io.IOExceptionCopyright © 1998–2018. All rights reserved.