Home » pdfbox-1.1.0-src » org.apache.pdfbox.pdfparser » [javadoc | source]
org.apache.pdfbox.pdfparser
abstract public class: BaseParser [javadoc | source]
java.lang.Object
   org.apache.pdfbox.pdfparser.BaseParser

Direct Known Subclasses:
    PDFObjectStreamParser, PDFParser, PDFStreamParser, PDFXrefStreamParser

This class is used to contain parsing logic that will be used by both the PDFParser and the COSStreamParser.
Field Summary
public static final  byte[] ENDSTREAM    This is a byte array that will be used for comparisons. 
public static final  byte[] ENDOBJ    This is a byte array that will be used for comparisons. 
public static final  String DEF    This is a byte array that will be used for comparisons. 
protected  PushBackInputStream pdfSource    This is the stream that will be read from. 
protected  COSDocument document    This is the document that will be parsed. 
Constructor:
 public BaseParser(InputStream input) throws IOException 
    Constructor.
    Parameters:
    input - The input stream to read the data from.
    Throws:
    IOException - If there is an error reading the input stream.
 protected BaseParser(byte[] input) throws IOException 
    Constructor.
    Parameters:
    input - The array to read the data from.
    Throws:
    IOException - If there is an error reading the byte data.
Method from org.apache.pdfbox.pdfparser.BaseParser Summary:
isClosing,   isClosing,   isEOL,   isEOL,   isEndOfName,   isWhitespace,   isWhitespace,   parseBoolean,   parseCOSArray,   parseCOSDictionary,   parseCOSName,   parseCOSStream,   parseCOSString,   parseDirObject,   readExpectedString,   readInt,   readLine,   readString,   readString,   setDocument,   skipSpaces
Methods from java.lang.Object:
clone,   equals,   finalize,   getClass,   hashCode,   notify,   notifyAll,   toString,   wait,   wait,   wait
Method from org.apache.pdfbox.pdfparser.BaseParser Detail:
 protected boolean isClosing() throws IOException 
    This will tell if the next character is a closing brace( close of PDF array ).
 protected boolean isClosing(int c) 
    This will tell if the next character is a closing brace( close of PDF array ).
 protected boolean isEOL() throws IOException 
    This will tell if the next byte to be read is an end of line byte.
 protected boolean isEOL(int c) 
    This will tell if the next byte to be read is an end of line byte.
 protected boolean isEndOfName(char ch) 
    Determine if a character terminates a PDF name.
 protected boolean isWhitespace() throws IOException 
    This will tell if the next byte is whitespace or not.
 protected boolean isWhitespace(int c) 
    This will tell if the next byte is whitespace or not.
 protected COSBoolean parseBoolean() throws IOException 
    This will parse a boolean object from the stream.
 protected COSArray parseCOSArray() throws IOException 
    This will parse a PDF array object.
 protected COSDictionary parseCOSDictionary() throws IOException 
    This will parse a PDF dictionary.
 protected COSName parseCOSName() throws IOException 
    This will parse a PDF name from the stream.
 protected COSStream parseCOSStream(COSDictionary dic,
    RandomAccess file) throws IOException 
    This will read a COSStream from the input stream.
 protected COSString parseCOSString() throws IOException 
    This will parse a PDF string.
 protected COSBase parseDirObject() throws IOException 
    This will parse a directory object from the stream.
 protected String readExpectedString(String theString) throws IOException 
    This will read bytes until the end of line marker occurs.
 protected int readInt() throws IOException 
    This will read an integer from the stream.
 protected String readLine() throws IOException 
    This will read bytes until the first end of line marker occurs. Note: if you later unread the results of this function, you'll need to add a newline character to the end of the string.
 protected String readString() throws IOException 
    This will read the next string from the stream.
 protected String readString(int length) throws IOException 
    This will read the next string from the stream up to a certain length.
 public  void setDocument(COSDocument doc) 
    Set the document for this stream.
 protected  void skipSpaces() throws IOException 
    This will skip all spaces and comments that are present.