Class COSParser

All Implemented Interfaces:
Closeable, AutoCloseable

class COSParser extends BaseCOSParser
Parser for COS objects capable of handling indirect references.
  • Field Details

  • Constructor Details

    • COSParser

      COSParser(org.sejda.io.SeekableSource source)
    • COSParser

      COSParser(org.sejda.io.SeekableSource source, IndirectObjectsProvider provider)
  • Method Details

    • nextParsedToken

      public COSBase nextParsedToken() throws IOException
      Specified by:
      nextParsedToken in class BaseCOSParser
      Returns:
      The next parsed basic type object from the stream or null if the next token is not a COSBase. Basic types are defined in Chap 7.3 of PDF 32000-1:2008
      Throws:
      IOException - If there is an error during parsing.
    • nextNumberOrIndirectReference

      public COSBase nextNumberOrIndirectReference() throws IOException
      Returns:
      The next parsed numeric object from the stream or the next indirect object in case the number is an object number . Numeric objects are defined in Chap 7.3.3 of PDF 32000-1:2008. Indirect objects are defined in Chap 7.3.10 of PDF 32000-1:2008
      Throws:
      IOException - If there is an error during parsing.
      See Also:
    • provider

      public IndirectObjectsProvider provider()
    • close

      public void close() throws IOException
      Closes the parser but not the associated provider
      Specified by:
      close in interface AutoCloseable
      Specified by:
      close in interface Closeable
      Overrides:
      close in class SourceReader
      Throws:
      IOException