Top Description Fields Constructors Methods
org.apache.pdfbox.io

public Class RandomAccessReadWriteBuffer

extends RandomAccessReadBuffer
implements RandomAccess
Class Inheritance
All Implemented Interfaces
org.apache.pdfbox.io.RandomAccess, org.apache.pdfbox.io.RandomAccessWrite, java.io.Closeable, java.lang.AutoCloseable, org.apache.pdfbox.io.RandomAccessRead
Imports
java.io.IOException

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

Inherited from org.apache.pdfbox.io.RandomAccessReadBuffer:
chunkSizecurrentBuffercurrentBufferPointerDEFAULT_CHUNK_SIZE_4KBpointersize

Constructor Summary

AccessConstructor and Description
public
RandomAccessReadWriteBuffer()

Default constructor.

public
RandomAccessReadWriteBuffer(int definedChunkSize)

Default constructor.

Method Summary

Modifier and TypeMethod and Description
public void
clear()

Implements org.apache.pdfbox.io.RandomAccessWrite.clear.

Clears all data of the buffer.

public void
write(int
The byte to write.
b
)

Implements org.apache.pdfbox.io.RandomAccessWrite.write.

Write a byte to the stream.

public void
write(byte[]
The buffer to get the data from.
b
)

Implements org.apache.pdfbox.io.RandomAccessWrite.write.

Write a buffer of data to the stream.

public void
write(byte[]
The buffer to get the data from.
b
,
int
An offset into the buffer to get the data from.
off
,
int
The length of data to write.
len
)

Implements org.apache.pdfbox.io.RandomAccessWrite.write.

Write a buffer of data to the stream.

Inherited from org.apache.pdfbox.io.RandomAccessReadBuffer:
checkClosedclosecreateBufferFromStreamcreateViewexpandBuffergetPositionisClosedisEOFlengthreadreadresetBuffersseek

Constructor Detail

RandomAccessReadWriteBufferback to summary
public RandomAccessReadWriteBuffer()

Default constructor.

RandomAccessReadWriteBufferback to summary
public RandomAccessReadWriteBuffer(int definedChunkSize)

Default constructor.

Method Detail

clearback to summary
public void clear() throws IOException

Implements org.apache.pdfbox.io.RandomAccessWrite.clear.

Doc from org.apache.pdfbox.io.RandomAccessWrite.clear.

Clears all data of the buffer.

Annotations
@Override
Exceptions
IOException:
If there is an error while clearing the data.
writeback to summary
public void write(int b) throws IOException

Implements org.apache.pdfbox.io.RandomAccessWrite.write.

Doc from org.apache.pdfbox.io.RandomAccessWrite.write.

Write a byte to the stream.

Parameters
b:int

The byte to write.

Annotations
@Override
Exceptions
IOException:
If there is an IO error while writing.
writeback to summary
public void write(byte[] b) throws IOException

Implements org.apache.pdfbox.io.RandomAccessWrite.write.

Doc from org.apache.pdfbox.io.RandomAccessWrite.write.

Write a buffer of data to the stream.

Parameters
b:byte[]

The buffer to get the data from.

Annotations
@Override
Exceptions
IOException:
If there is an error while writing the data.
writeback to summary
public void write(byte[] b, int off, int len) throws IOException

Implements org.apache.pdfbox.io.RandomAccessWrite.write.

Doc from org.apache.pdfbox.io.RandomAccessWrite.write.

Write a buffer of data to the stream.

Parameters
b:byte[]

The buffer to get the data from.

off:int

An offset into the buffer to get the data from.

len:int

The length of data to write.

Annotations
@Override
Exceptions
IOException:
If there is an error while writing the data.