Package org.apache.pdfbox.io
Interface RandomAccessRead
-
- All Superinterfaces:
SequentialRead
- All Known Subinterfaces:
RandomAccess
- All Known Implementing Classes:
RandomAccessBuffer,RandomAccessBufferedFileInputStream,RandomAccessFile
public interface RandomAccessRead extends SequentialRead
An interface allowing random access read operations.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description longgetPosition()Returns offset of next byte to be returned by a read method.longlength()The total number of bytes that are available.voidseek(long position)Seek to a position in the data.-
Methods inherited from interface org.apache.pdfbox.io.SequentialRead
close, read, read
-
-
-
-
Method Detail
-
getPosition
long getPosition() throws java.io.IOExceptionReturns offset of next byte to be returned by a read method.- Returns:
- offset of next byte which will be returned with next
SequentialRead.read()(if no more bytes are left it returns a value >= length of source) - Throws:
java.io.IOException
-
seek
void seek(long position) throws java.io.IOException
Seek to a position in the data.- Parameters:
position- The position to seek to.- Throws:
java.io.IOException- If there is an error while seeking.
-
length
long length() throws java.io.IOExceptionThe total number of bytes that are available.- Returns:
- The number of bytes available.
- Throws:
java.io.IOException- If there is an IO error while determining the length of the data stream.
-
-