public class WindowRandomAccessSource extends Object implements RandomAccessSource
Constructor and 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 and 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 source
offset
- the amount of the offset to use
public WindowRandomAccessSource(RandomAccessSource source, long offset, long length)
source
- the source
offset
- the amount of the offset to use
length
- the number of bytes to be included in this RAS
public int get(long position) throws IOException
get
in interface RandomAccessSource
IOException
public int get(long position, byte[] bytes, int off, int len) throws IOException
get
in interface RandomAccessSource
position
- the position in the RandomAccessSource to read from
bytes
- output buffer
off
- offset into the output buffer where results will be placed
len
- the number of bytes to read
IOException
public long length()
length
in interface RandomAccessSource
public void close() throws IOException
close
in interface RandomAccessSource
IOException
Copyright © 2016. All rights reserved.