Package org.verapdf.parser
Class NotSeekableBaseParser
- java.lang.Object
-
- org.verapdf.parser.NotSeekableBaseParser
-
- All Implemented Interfaces:
Closeable,AutoCloseable
- Direct Known Subclasses:
NotSeekableCOSParser,Type3CharProcParser
public class NotSeekableBaseParser extends Object implements Closeable
Base PDF parser that operates with a buffered stream. The seek() operation of stream is not required.- Author:
- Sergey Shemyakov
-
-
Field Summary
Fields Modifier and Type Field Description protected booleanisPSParserprotected ASBufferedInFiltersource
-
Constructor Summary
Constructors Constructor Description NotSeekableBaseParser(ASInputStream stream)Constructor from stream.NotSeekableBaseParser(ASInputStream fileStream, boolean isPSParser)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description voidclose()Closes source stream.static byte[]extendArray(byte[] array)protected booleanfindKeyword(Token.Keyword keyword)protected booleanfindKeyword(Token.Keyword keyword, int lookUpSize)protected byte[]getLineBytes()protected TokengetToken()protected voidinitializeToken()protected 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 voidnextToken()protected voidreadLine()protected voidreadNumber()protected StringreadUntilDelimiter()protected voidskipSpaces()protected voidskipSpaces(boolean skipComment)protected voidskipStreamSpaces()
-
-
-
Field Detail
-
isPSParser
protected boolean isPSParser
-
source
protected ASBufferedInFilter source
-
-
Constructor Detail
-
NotSeekableBaseParser
public NotSeekableBaseParser(ASInputStream stream) throws IOException
Constructor from stream. New buffered stream from given stream is created.- Parameters:
stream- is source data stream.- Throws:
IOException
-
NotSeekableBaseParser
public NotSeekableBaseParser(ASInputStream fileStream, boolean isPSParser) throws IOException
- Throws:
IOException
-
-
Method Detail
-
close
public void close() throws IOExceptionCloses source stream.- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable- Throws:
IOException
-
initializeToken
protected void initializeToken()
-
getToken
protected Token getToken()
-
readLine
protected void readLine() throws IOException- Throws:
IOException
-
getLineBytes
protected byte[] getLineBytes() throws IOException- Throws:
IOException
-
readUntilDelimiter
protected String readUntilDelimiter() throws IOException
- Throws:
IOException
-
findKeyword
protected boolean findKeyword(Token.Keyword keyword) throws IOException
- Throws:
IOException
-
findKeyword
protected boolean findKeyword(Token.Keyword keyword, int lookUpSize) throws IOException
- Throws:
IOException
-
nextToken
protected void nextToken() throws IOException- Throws:
IOException
-
skipSpaces
protected void skipSpaces() throws IOException- Throws:
IOException
-
skipSpaces
protected void skipSpaces(boolean skipComment) throws IOException- Throws:
IOException
-
skipStreamSpaces
protected void skipStreamSpaces() throws IOException- Throws:
IOException
-
isDigit
protected boolean isDigit() throws IOException- 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
protected void readNumber() throws IOException- Throws:
IOException
-
-