org.pdfbox.io
Interface RandomAccess
- RandomAccessBuffer, RandomAccessFile
public interface RandomAccess
An interface to allow PDF files to be stored completely in memory or
to use a scratch file on the disk.
void | close()- Release resources that are being held.
|
long | length()- The total number of bytes that are available.
|
int | read()- Read a single byte of data.
|
int | read(byte[] b, int offset, int length)- Read a buffer of data.
|
void | seek(long position)- Seek to a position in the data.
|
void | write(byte[] b, int offset, int length)- Write a buffer of data to the stream.
|
void | write(int b)- Write a byte to the stream.
|
close
public void close()
throws IOException Release resources that are being held.
length
public long length()
throws IOException The total number of bytes that are available.
- The number of bytes available.
read
public int read()
throws IOException Read a single byte of data.
- The byte of data that is being read.
read
public int read(byte[] b,
int offset,
int length)
throws IOException Read a buffer of data.
b - The buffer to write the data to.offset - Offset into the buffer to start writing.length - The amount of data to attempt to read.
- The number of bytes that were actually read.
seek
public void seek(long position)
throws IOException Seek to a position in the data.
position - The position to seek to.
write
public void write(byte[] b,
int offset,
int length)
throws IOException Write a buffer of data to the stream.
b - The buffer to get the data from.offset - An offset into the buffer to get the data from.length - The length of data to write.
write
public void write(int b)
throws IOException Write a byte to the stream.