Class PDFObjectStreamParser

java.lang.Object
org.apache.pdfbox.pdfparser.BaseParser
org.apache.pdfbox.pdfparser.PDFObjectStreamParser

public class PDFObjectStreamParser extends BaseParser
This will parse a PDF 1.5 object stream and extract all of the objects from the stream.
  • Field Details

    • LOG

      private static final org.apache.commons.logging.Log LOG
      Log instance.
    • streamObjects

      private List<COSObject> streamObjects
    • numberOfObjects

      private final int numberOfObjects
    • firstObject

      private final int firstObject
  • Constructor Details

    • PDFObjectStreamParser

      public PDFObjectStreamParser(COSStream stream, COSDocument document) throws IOException
      Constructor.
      Parameters:
      stream - The stream to parse.
      document - The document for the current parsing.
      Throws:
      IOException - If there is an error initializing the stream.
  • Method Details

    • parse

      public void parse() throws IOException
      This will parse the tokens in the stream. This will close the stream when it is finished parsing.
      Throws:
      IOException - If there is an error while parsing the stream.
    • getObjects

      public List<COSObject> getObjects()
      This will get the objects that were parsed from the stream.
      Returns:
      All of the objects in the stream.
    • readOffsets

      private Map<Integer,Long> readOffsets() throws IOException
      Throws:
      IOException
    • parseObject

      private COSBase parseObject(int offset) throws IOException
      Throws:
      IOException