Class COSParser


  • public final class COSParser
    extends java.lang.Object
    A low level, recursive-descent parser that turns the raw bytes of a PDF file into a populated COSDocument: every indirect object, the cross-reference table (classic tables, cross-reference streams, hybrid files, incremental updates via /Prev, and compressed objects held in object streams), and the trailer.

    If the cross-reference information is missing, points at garbage, or forms a broken chain, parse() falls back to a brute-force linear scan for "n g obj" headers, the same recovery strategy used by essentially every real-world PDF reader to cope with the very common case of a corrupt or non-conformant xref section.