|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.itextpdf.text.io.WindowRandomAccessSource
public class WindowRandomAccessSource
A RandomAccessSource that wraps another RandomAccessSouce and provides a window of it at a specific offset and over a specific length. Position 0 becomes the offset position in the underlying source.
Constructor Summary | |
---|---|
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 |
Method Summary | |
---|---|
void |
close()
Closes this source. |
int |
get(long position)
Gets a byte at the specified position Note that the position will be adjusted to read from the corrected location in the underlying source |
int |
get(long position,
byte[] bytes,
int off,
int len)
Gets an array at the specified position. Note that the position will be adjusted to read from the corrected location in the underlying source |
long |
length()
Note that the length will be adjusted to read from the corrected location in the underlying source |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
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 RASMethod Detail |
---|
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 frombytes
- output bufferoff
- offset into the output buffer where results will be placedlen
- the number of bytes to read
IOException
public long length()
length
in interface RandomAccessSource
public void close() throws IOException
close
in interface RandomAccessSource
IOException
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |