Package com.lowagie.text.pdf
Class PRTokeniser
- java.lang.Object
-
- com.lowagie.text.pdf.PRTokeniser
-
- All Implemented Interfaces:
AutoCloseable
public class PRTokeniser extends Object implements AutoCloseable
- Author:
- Paulo Soares (psoares@consiste.pt)
-
-
Field Summary
Fields Modifier and Type Field Description static boolean[]delimsprotected RandomAccessFileOrArrayfileprotected intgenerationprotected booleanhexStringprotected intreferenceprotected StringstringValuestatic intTK_COMMENTstatic intTK_END_ARRAYstatic intTK_END_DICstatic intTK_ENDOFFILEstatic intTK_NAMEstatic intTK_NUMBERstatic intTK_OTHERstatic intTK_REFstatic intTK_START_ARRAYstatic intTK_START_DICstatic intTK_STRINGprotected inttype
-
Constructor Summary
Constructors Constructor Description PRTokeniser(byte[] pdfIn)PRTokeniser(RandomAccessFileOrArray file)PRTokeniser(String filename)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description voidbackOnePosition(int ch)voidcheckFdfHeader()static int[]checkObjectStart(byte[] line)charcheckPdfHeader()voidclose()RandomAccessFileOrArraygetFile()intgetFilePointer()intgetGeneration()static intgetHex(int v)intgetReference()RandomAccessFileOrArraygetSafeFile()intgetStartxref()StringgetStringValue()intgetTokenType()intintValue()static booleanisDelimiter(int ch)static booleanisDelimiterWhitespace(int ch)booleanisHexString()static booleanisWhitespace(int ch)intlength()booleannextToken()voidnextValidToken()intread()booleanreadLineSegment(byte[] input)StringreadString(int size)voidseek(int pos)voidthrowError(String error)
-
-
-
Field Detail
-
TK_NUMBER
public static final int TK_NUMBER
- See Also:
- Constant Field Values
-
TK_STRING
public static final int TK_STRING
- See Also:
- Constant Field Values
-
TK_NAME
public static final int TK_NAME
- See Also:
- Constant Field Values
-
TK_COMMENT
public static final int TK_COMMENT
- See Also:
- Constant Field Values
-
TK_START_ARRAY
public static final int TK_START_ARRAY
- See Also:
- Constant Field Values
-
TK_END_ARRAY
public static final int TK_END_ARRAY
- See Also:
- Constant Field Values
-
TK_START_DIC
public static final int TK_START_DIC
- See Also:
- Constant Field Values
-
TK_END_DIC
public static final int TK_END_DIC
- See Also:
- Constant Field Values
-
TK_REF
public static final int TK_REF
- See Also:
- Constant Field Values
-
TK_OTHER
public static final int TK_OTHER
- See Also:
- Constant Field Values
-
TK_ENDOFFILE
public static final int TK_ENDOFFILE
- See Also:
- Constant Field Values
-
delims
public static final boolean[] delims
-
file
protected RandomAccessFileOrArray file
-
type
protected int type
-
stringValue
protected String stringValue
-
reference
protected int reference
-
generation
protected int generation
-
hexString
protected boolean hexString
-
-
Constructor Detail
-
PRTokeniser
public PRTokeniser(String filename) throws IOException
- Throws:
IOException
-
PRTokeniser
public PRTokeniser(byte[] pdfIn)
-
PRTokeniser
public PRTokeniser(RandomAccessFileOrArray file)
-
-
Method Detail
-
seek
public void seek(int pos) throws IOException- Throws:
IOException
-
getFilePointer
public int getFilePointer() throws IOException- Throws:
IOException
-
close
public void close() throws IOException- Specified by:
closein interfaceAutoCloseable- Throws:
IOException
-
length
public int length() throws IOException- Throws:
IOException
-
read
public int read() throws IOException- Throws:
IOException
-
getSafeFile
public RandomAccessFileOrArray getSafeFile()
-
getFile
public RandomAccessFileOrArray getFile()
-
readString
public String readString(int size) throws IOException
- Throws:
IOException
-
isWhitespace
public static final boolean isWhitespace(int ch)
-
isDelimiter
public static final boolean isDelimiter(int ch)
-
isDelimiterWhitespace
public static final boolean isDelimiterWhitespace(int ch)
-
getTokenType
public int getTokenType()
-
getStringValue
public String getStringValue()
-
getReference
public int getReference()
-
getGeneration
public int getGeneration()
-
backOnePosition
public void backOnePosition(int ch)
-
throwError
public void throwError(String error) throws IOException
- Throws:
IOException
-
checkPdfHeader
public char checkPdfHeader() throws IOException- Throws:
IOException
-
checkFdfHeader
public void checkFdfHeader() throws IOException- Throws:
IOException
-
getStartxref
public int getStartxref() throws IOException- Throws:
IOException
-
getHex
public static int getHex(int v)
-
nextValidToken
public void nextValidToken() throws IOException- Throws:
IOException
-
nextToken
public boolean nextToken() throws IOException- Throws:
IOException
-
intValue
public int intValue()
-
readLineSegment
public boolean readLineSegment(byte[] input) throws IOException- Throws:
IOException
-
checkObjectStart
public static int[] checkObjectStart(byte[] line)
-
isHexString
public boolean isHexString()
-
-