pdf-lite - v1.0.1
    Preparing search index...

    Class PdfByteStreamTokeniser

    Tokenizes a byte stream into PDF tokens. Handles all PDF syntax including objects, streams, and xref tables.

    Hierarchy (View Summary)

    Index

    Constructors

    Properties

    buffer: number[] = []

    Buffer holding input items

    bufferIndex: number = 0

    Current position in the buffer

    eof: boolean = false

    Whether end of file has been signaled

    inputOffset: number = 0

    Current position in the input stream

    outputOffset: number = 0

    Number of outputs generated

    Methods

    • Consumes and validates the next item against an expected type or value.

      Type Parameters

      • T extends number

        The expected item type

      Parameters

      • itemType: T | (new (...args: any[]) => T)

        Constructor or value to match against

      Returns T

      The consumed item cast to the expected type

      Error if the item doesn't match the expected type/value

    • Peeks at an item in the buffer without consuming it.

      Parameters

      • ahead: number = 0

        Number of positions to look ahead (default: 0)

      Returns number | null

      The item at the peek position, or null if at EOF

      NoMoreTokensError if more input is needed and EOF not signaled