Package org.apache.pdfbox.io
Class RandomAccessReadWriteBuffer
java.lang.Object
org.apache.pdfbox.io.RandomAccessReadBuffer
org.apache.pdfbox.io.RandomAccessReadWriteBuffer
- All Implemented Interfaces:
Closeable,AutoCloseable,RandomAccess,RandomAccessRead,RandomAccessWrite
An implementation of the RandomAccess interface to store data in memory. The data will be stored in chunks organized
in an ArrayList. The data can be read after writing.
-
Field Summary
Fields inherited from class org.apache.pdfbox.io.RandomAccessReadBuffer
chunkSize, currentBuffer, currentBufferPointer, DEFAULT_CHUNK_SIZE_4KB, pointer, size -
Constructor Summary
ConstructorsConstructorDescriptionDefault constructor.RandomAccessReadWriteBuffer(int definedChunkSize) Default constructor. -
Method Summary
Methods inherited from class org.apache.pdfbox.io.RandomAccessReadBuffer
checkClosed, close, createBufferFromStream, createView, expandBuffer, getPosition, isClosed, isEOF, length, read, read, resetBuffers, seekMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.apache.pdfbox.io.RandomAccessRead
available, createView, getPosition, isClosed, isEOF, length, peek, read, read, read, rewind, seek, skip
-
Constructor Details
-
RandomAccessReadWriteBuffer
public RandomAccessReadWriteBuffer()Default constructor. -
RandomAccessReadWriteBuffer
public RandomAccessReadWriteBuffer(int definedChunkSize) Default constructor.
-
-
Method Details
-
clear
Clears all data of the buffer.- Specified by:
clearin interfaceRandomAccessWrite- Throws:
IOException- If there is an error while clearing the data.
-
write
Write a byte to the stream.- Specified by:
writein interfaceRandomAccessWrite- Parameters:
b- The byte to write.- Throws:
IOException- If there is an IO error while writing.
-
write
Write a buffer of data to the stream.- Specified by:
writein interfaceRandomAccessWrite- Parameters:
b- The buffer to get the data from.- Throws:
IOException- If there is an error while writing the data.
-
write
Write a buffer of data to the stream.- Specified by:
writein interfaceRandomAccessWrite- Parameters:
b- The buffer to get the data from.off- An offset into the buffer to get the data from.len- The length of data to write.- Throws:
IOException- If there is an error while writing the data.
-