Class PDFXrefStreamParser


  • public class PDFXrefStreamParser
    extends BaseParser
    This will parse a PDF 1.5 (or better) Xref stream and extract the xref information from the stream.
    • Field Detail

      • w

        private final int[] w
      • objNums

        private final java.util.List<java.lang.Long> objNums
    • Constructor Detail

      • PDFXrefStreamParser

        public PDFXrefStreamParser​(COSStream stream,
                                   COSDocument document,
                                   XrefTrailerResolver resolver)
                            throws java.io.IOException
        Constructor.
        Parameters:
        stream - The stream to parse.
        document - The document for the current parsing.
        resolver - resolver to read the xref/trailer information
        Throws:
        java.io.IOException - If there is an error initializing the stream.
    • Method Detail

      • initParserValues

        private void initParserValues​(COSStream stream)
                               throws java.io.IOException
        Throws:
        java.io.IOException
      • close

        private void close()
                    throws java.io.IOException
        Throws:
        java.io.IOException
      • parse

        public void parse()
                   throws java.io.IOException
        Parses through the unfiltered stream and populates the xrefTable HashMap.
        Throws:
        java.io.IOException - If there is an error while parsing the stream.
      • parseValue

        private long parseValue​(byte[] data,
                                int start,
                                int length)