org.pdfbox.io

Class RandomAccessFile

Implemented Interfaces:
RandomAccess

public class RandomAccessFile
extends java.lang.Object
implements RandomAccess

An interface to allow temp PDF data to be stored in a scratch file on the disk to reduce memory consumption.
Version:
$Revision: 1.2 $
Author:
Ben Litchfield

Constructor Summary

RandomAccessFile(File file, String mode)
Constructor.

Method Summary

void
close()
long
length()
int
read()
int
read(byte[] b, int offset, int length)
void
seek(long position)
void
write(byte[] b, int offset, int length)
void
write(int b)

Constructor Details

RandomAccessFile

public RandomAccessFile(File file,
                        String mode)
            throws FileNotFoundException
Constructor.
Parameters:
file - The file to write the data to.
mode - The writing mode.

Method Details

close

public void close()
            throws IOException
Specified by:
close in interface RandomAccess

length

public long length()
            throws IOException
Specified by:
length in interface RandomAccess

read

public int read()
            throws IOException
Specified by:
read in interface RandomAccess

read

public int read(byte[] b,
                int offset,
                int length)
            throws IOException
Specified by:
read in interface RandomAccess

seek

public void seek(long position)
            throws IOException
Specified by:
seek in interface RandomAccess

write

public void write(byte[] b,
                  int offset,
                  int length)
            throws IOException
Specified by:
write in interface RandomAccess

write

public void write(int b)
            throws IOException
Specified by:
write in interface RandomAccess