PDFLexer

Overview

PDFLexer is a class in Aspose.PDF FOSS for Java.

PDF tokenizer: converts a byte stream into a sequence of PDF tokens.

This class provides 6 methods for working with PDFLexer objects in Java programs. Available methods include: PDFLexer, clearPeek, getPosition, nextToken, peekToken, skipWhitespaceAndComments. All public members are accessible to any Java application after installing the Aspose.PDF FOSS for Java package. Properties: position.

Properties

NameTypeAccessDescription
positionlongReadReturns the current byte position in the underlying reader.

Methods

SignatureDescription
PDFLexer(reader: RandomAccessReader)Constructs a new PDFLexer reading from the given source.
nextToken() → TokenReads and returns the next token from the input, consuming it.
peekToken() → TokenReturns the next token without consuming it.
getPosition() → longReturns the current byte position in the underlying reader.
clearPeek()Clears any peeked (buffered) token.
skipWhitespaceAndComments()Skips whitespace characters and comments.

See Also

 English