public class ThreadSafeRandomAccessSource extends Object implements IRandomAccessSource
Constructor and Description |
---|
ThreadSafeRandomAccessSource(IRandomAccessSource source) |
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 ThreadSafeRandomAccessSource(IRandomAccessSource source)
public int get(long position) throws IOException
IRandomAccessSource
get
in interface IRandomAccessSource
position
- byte position
IOException
- in case of any reading error.
public int get(long position, byte[] bytes, int off, int len) throws IOException
IRandomAccessSource
get
in interface IRandomAccessSource
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
- in case of any I/O error.
public long length()
IRandomAccessSource
length
in interface IRandomAccessSource
public void close() throws IOException
IRandomAccessSource
close
in interface IRandomAccessSource
IOException
- in case of any reading error.
Copyright © 1998–2020 iText Group NV. All rights reserved.