Package org.verapdf.parser
Class NotSeekableBaseParser
java.lang.Object
org.verapdf.parser.NotSeekableBaseParser
- All Implemented Interfaces:
Closeable,AutoCloseable
- Direct Known Subclasses:
NotSeekableCOSParser,Type3CharProcParser
Base PDF parser that operates with a buffered stream. The seek() operation
of stream is not required.
- Author:
- Sergey Shemyakov
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionNotSeekableBaseParser(ASInputStream stream) Constructor from stream.NotSeekableBaseParser(ASInputStream fileStream, boolean isPSParser) -
Method Summary
Modifier and TypeMethodDescriptionvoidclose()Closes source stream.static byte[]extendArray(byte[] array) protected booleanfindKeyword(Token.Keyword keyword) protected booleanfindKeyword(Token.Keyword keyword, int lookUpSize) protected byte[]protected TokengetToken()protected voidprotected static booleanisCR(int c) protected booleanisDigit()protected static booleanisDigit(byte c) protected booleanisEndOfComment(byte ch) protected static booleanisFF(int c) protected static booleanisLF(int c) protected voidprotected voidreadLine()protected voidprotected Stringprotected voidprotected voidskipSpaces(boolean skipComment) protected void
-
Field Details
-
isPSParser
protected boolean isPSParser -
source
-
-
Constructor Details
-
NotSeekableBaseParser
Constructor from stream. New buffered stream from given stream is created.- Parameters:
stream- is source data stream.- Throws:
IOException
-
NotSeekableBaseParser
- Throws:
IOException
-
-
Method Details
-
close
Closes source stream.- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable- Throws:
IOException
-
initializeToken
protected void initializeToken() -
getToken
-
readLine
- Throws:
IOException
-
getLineBytes
- Throws:
IOException
-
readUntilDelimiter
- Throws:
IOException
-
findKeyword
- Throws:
IOException
-
findKeyword
- Throws:
IOException
-
nextToken
- Throws:
IOException
-
skipSpaces
- Throws:
IOException
-
skipSpaces
- Throws:
IOException
-
skipStreamSpaces
- Throws:
IOException
-
isDigit
- Throws:
IOException
-
isDigit
protected static boolean isDigit(byte c) -
isEndOfComment
protected boolean isEndOfComment(byte ch) -
isFF
protected static boolean isFF(int c) -
isLF
protected static boolean isLF(int c) -
isCR
protected static boolean isCR(int c) -
extendArray
public static byte[] extendArray(byte[] array) -
readNumber
- Throws:
IOException
-