com.itextpdf.text.pdf
Class PRTokeniser

java.lang.Object
  extended by com.itextpdf.text.pdf.PRTokeniser

public class PRTokeniser
extends Object

Author:
Paulo Soares

Nested Class Summary
static class PRTokeniser.TokenType
          Enum representing the possible token types
 
Field Summary
static boolean[] delims
           
protected  int generation
           
protected  boolean hexString
           
protected  int reference
           
protected  String stringValue
           
protected  PRTokeniser.TokenType type
           
 
Constructor Summary
PRTokeniser(RandomAccessFileOrArray file)
          Creates a PRTokeniser for the specified RandomAccessFileOrArray.
 
Method Summary
 void backOnePosition(int ch)
           
 void checkFdfHeader()
           
static long[] checkObjectStart(byte[] line)
           
 char checkPdfHeader()
           
 void close()
           
 RandomAccessFileOrArray getFile()
           
 long getFilePointer()
           
 int getGeneration()
           
 int getHeaderOffset()
           
static int getHex(int v)
           
 int getReference()
           
 RandomAccessFileOrArray getSafeFile()
           
 long getStartxref()
           
 String getStringValue()
           
 PRTokeniser.TokenType getTokenType()
           
 int intValue()
           
static boolean isDelimiter(int ch)
           
static boolean isDelimiterWhitespace(int ch)
           
 boolean isHexString()
           
static boolean isWhitespace(int ch)
           
 long length()
           
 long longValue()
           
 boolean nextToken()
           
 void nextValidToken()
           
 int read()
           
 boolean readLineSegment(byte[] input)
           
 String readString(int size)
           
 void seek(long pos)
           
 void throwError(String error)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

delims

public static final boolean[] delims

type

protected PRTokeniser.TokenType type

stringValue

protected String stringValue

reference

protected int reference

generation

protected int generation

hexString

protected boolean hexString
Constructor Detail

PRTokeniser

public PRTokeniser(RandomAccessFileOrArray file)
Creates a PRTokeniser for the specified RandomAccessFileOrArray. The beginning of the file is read to determine the location of the header, and the data source is adjusted as necessary to account for any junk that occurs in the byte source before the header

Parameters:
file - the source
Method Detail

seek

public void seek(long pos)
          throws IOException
Throws:
IOException

getFilePointer

public long getFilePointer()
                    throws IOException
Throws:
IOException

close

public void close()
           throws IOException
Throws:
IOException

length

public long 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 PRTokeniser.TokenType 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

getHeaderOffset

public int getHeaderOffset()
                    throws IOException
Throws:
IOException

checkPdfHeader

public char checkPdfHeader()
                    throws IOException
Throws:
IOException

checkFdfHeader

public void checkFdfHeader()
                    throws IOException
Throws:
IOException

getStartxref

public long 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

longValue

public long longValue()

intValue

public int intValue()

readLineSegment

public boolean readLineSegment(byte[] input)
                        throws IOException
Throws:
IOException

checkObjectStart

public static long[] checkObjectStart(byte[] line)

isHexString

public boolean isHexString()


Copyright © 2013. All Rights Reserved.