|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.apache.pdfbox.io.RandomAccessBuffer
public class RandomAccessBuffer
An implementation of the RandomAccess interface to store a pdf in memory. The data will be stored in 16kb chunks organized in an ArrayList.
| Constructor Summary | |
|---|---|
RandomAccessBuffer()
Default constructor. |
|
| Method Summary | |
|---|---|
RandomAccessBuffer |
clone()
|
void |
close()
Release resources that are being held. |
long |
getPosition()
Returns offset of next byte to be returned by a read method. |
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. |
| Methods inherited from class java.lang.Object |
|---|
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public RandomAccessBuffer()
| Method Detail |
|---|
public RandomAccessBuffer clone()
clone in class Object
public void close()
throws IOException
close in interface Closeableclose in interface SequentialReadIOException - If there is an error closing this resource.
public void seek(long position)
throws IOException
seek in interface RandomAccessReadposition - The position to seek to.
IOException - If there is an error while seeking.
public long getPosition()
throws IOException
getPosition in interface RandomAccessReadSequentialRead.read()
(if no more bytes are left it returns a value >= length of source)
IOException
public int read()
throws IOException
read in interface SequentialReadIOException - If there is an error while reading the data.
public int read(byte[] b,
int offset,
int length)
throws IOException
read in interface SequentialReadb - The buffer to write the data to.offset - Offset into the buffer to start writing.length - The amount of data to attempt to read.
IOException - If there was an error while reading the data.
public long length()
throws IOException
length in interface RandomAccessReadIOException - If there is an IO error while determining the
length of the data stream.
public void write(int b)
throws IOException
write in interface RandomAccessb - The byte to write.
IOException - If there is an IO error while writing.
public void write(byte[] b,
int offset,
int length)
throws IOException
write in interface RandomAccessb - 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.
IOException - If there is an error while writing the data.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||