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

    Modifier and Type
    Method
    Description
    long
    Returns offset of next byte to be returned by a read method.
    long
    The total number of bytes that are available.
    void
    seek(long position)
    Seek to a position in the data.

    Methods inherited from interface org.apache.pdfbox.io.SequentialRead

    close, read, read
  • Method Details

    • getPosition

      long getPosition() throws IOException
      Returns 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:
      IOException
    • seek

      void seek(long position) throws IOException
      Seek to a position in the data.
      Parameters:
      position - The position to seek to.
      Throws:
      IOException - If there is an error while seeking.
    • length

      long length() throws IOException
      The total number of bytes that are available.
      Returns:
      The number of bytes available.
      Throws:
      IOException - If there is an IO error while determining the length of the data stream.