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 boolean
isPSParser
protected ASBufferedInFilter
source
-
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 void
close()
Closes source stream.static byte[]
extendArray(byte[] array)
protected boolean
findKeyword(Token.Keyword keyword)
protected boolean
findKeyword(Token.Keyword keyword, int lookUpSize)
protected byte[]
getLineBytes()
protected Token
getToken()
protected void
initializeToken()
protected static boolean
isCR(int c)
protected boolean
isDigit()
protected static boolean
isDigit(byte c)
protected boolean
isEndOfComment(byte ch)
protected static boolean
isFF(int c)
protected static boolean
isLF(int c)
protected void
nextToken()
protected void
readLine()
protected void
readNumber()
protected String
readUntilDelimiter()
protected void
skipSpaces()
protected void
skipSpaces(boolean skipComment)
protected void
skipStreamSpaces()
-
-
-
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 IOException
Closes source stream.- Specified by:
close
in interfaceAutoCloseable
- Specified by:
close
in 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
-
-