public class WindowRandomAccessSource extends Object implements IRandomAccessSource, Serializable
| Constructor and Description |
|---|
WindowRandomAccessSource(IRandomAccessSource source,
long offset)
Constructs a new OffsetRandomAccessSource that extends to the end of the underlying source
|
WindowRandomAccessSource(IRandomAccessSource 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)
Read an array of bytes of specified length from the specified position of source to the buffer applying the offset.
|
long |
length()
Gets the length of the source
|
public WindowRandomAccessSource(IRandomAccessSource source, long offset)
source - the sourceoffset - the amount of the offset to usepublic WindowRandomAccessSource(IRandomAccessSource 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 IOException
get in interface IRandomAccessSourceposition - byte positionIOException - in case of any reading error.public int get(long position,
byte[] bytes,
int off,
int len)
throws IOException
get in interface IRandomAccessSourceposition - 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 readIOException - in case of any I/O error.public long length()
length in interface IRandomAccessSourcepublic void close()
throws IOException
close in interface IRandomAccessSourceIOExceptionCopyright © 1998–2018 iText Group NV. All rights reserved.