Package org.apache.pdfbox.io
Class RandomAccessFileInputStream
- java.lang.Object
-
- java.io.InputStream
-
- org.apache.pdfbox.io.RandomAccessFileInputStream
-
- All Implemented Interfaces:
java.io.Closeable
,java.lang.AutoCloseable
public class RandomAccessFileInputStream extends java.io.InputStream
This class allows a section of a RandomAccessFile to be accessed as an input stream.- Version:
- $Revision: 1.5 $
- Author:
- Ben Litchfield
-
-
Constructor Summary
Constructors Constructor Description RandomAccessFileInputStream(RandomAccess raFile, long startPosition, long length)
Constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description int
available()
void
close()
int
read()
int
read(byte[] b, int offset, int length)
long
skip(long amountToSkip)
-
-
-
Constructor Detail
-
RandomAccessFileInputStream
public RandomAccessFileInputStream(RandomAccess raFile, long startPosition, long length)
Constructor.- Parameters:
raFile
- The file to read the data from.startPosition
- The position in the file that this stream starts.length
- The length of the input stream.
-
-
Method Detail
-
available
public int available()
- Overrides:
available
in classjava.io.InputStream
-
close
public void close()
- Specified by:
close
in interfacejava.lang.AutoCloseable
- Specified by:
close
in interfacejava.io.Closeable
- Overrides:
close
in classjava.io.InputStream
-
read
public int read() throws java.io.IOException
- Specified by:
read
in classjava.io.InputStream
- Throws:
java.io.IOException
-
read
public int read(byte[] b, int offset, int length) throws java.io.IOException
- Overrides:
read
in classjava.io.InputStream
- Throws:
java.io.IOException
-
skip
public long skip(long amountToSkip)
- Overrides:
skip
in classjava.io.InputStream
-
-