|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Objectorg.pdfbox.pdfparser.BaseParser
This class is used to contain parsing logic that will be used by both the PDFParser and the COSStreamParser.
| Field Summary | |
static String |
DEF
This is a byte array that will be used for comparisons. |
static byte[] |
ENDSTREAM
This is a byte array that will be used for comparisons. |
protected PushBackInputStream |
pdfSource
This is the stream that will be read from. |
| Constructor Summary | |
protected |
BaseParser(byte[] input)
Constructor. |
|
BaseParser(InputStream input)
Constructor. |
| Method Summary | |
void |
addXref(PDFXref xref)
This will add an xref. |
List |
getXrefs()
This will get all of the xrefs. |
protected boolean |
isClosing()
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 |
isEndOfName(char ch)
Determine if a character terminates a PDF name. |
protected boolean |
isEOL()
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 |
isWhitespace()
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()
This will parse a boolean object from the stream. |
protected COSArray |
parseCOSArray()
This will parse a PDF array object. |
protected COSDictionary |
parseCOSDictionary()
This will parse a PDF dictionary. |
protected COSName |
parseCOSName()
This will parse a PDF name from the stream. |
protected COSStream |
parseCOSStream(COSDictionary dic,
RandomAccess file)
This will read a COSStream from the input stream. |
protected COSString |
parseCOSString()
This will parse a PDF string. |
protected COSBase |
parseDirObject()
This will parse a directory object from the stream. |
protected String |
readExpectedString(String theString)
This will read bytes until the end of line marker occurs. |
protected int |
readInt()
This will read an integer from the stream. |
protected String |
readLine()
This will read bytes until the end of line marker occurs. |
protected String |
readString()
This will read the next string from the stream. |
protected String |
readString(int length)
This will read the next string from the stream up to a certain length. |
void |
setDocument(COSDocument doc)
Set the document for this stream. |
protected void |
skipSpaces()
This will skip all spaces and comments that are present. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
public static final byte[] ENDSTREAM
public static final String DEF
protected PushBackInputStream pdfSource
| Constructor Detail |
public BaseParser(InputStream input)
throws IOException
input - The input stream to read the data from.
IOException - If there is an error reading the input stream.
protected BaseParser(byte[] input)
throws IOException
input - The array to read the data from.
IOException - If there is an error reading the byte data.| Method Detail |
public void setDocument(COSDocument doc)
doc - The current document.
protected COSDictionary parseCOSDictionary()
throws IOException
IOException - IF there is an error reading the stream.
protected COSStream parseCOSStream(COSDictionary dic,
RandomAccess file)
throws IOException
file - The file to write the stream to when reading.dic - The dictionary that goes with this stream.
IOException - If there is an error reading the stream.
protected COSString parseCOSString()
throws IOException
IOException - If there is an error reading from the stream.
protected COSArray parseCOSArray()
throws IOException
IOException - If there is an error parsing the stream.protected boolean isEndOfName(char ch)
ch - The character
true if the character terminates a PDF name, otherwise false.
protected COSName parseCOSName()
throws IOException
IOException - If there is an error reading from the stream.
protected COSBoolean parseBoolean()
throws IOException
IOException - If an IO error occurs during parsing.
protected COSBase parseDirObject()
throws IOException
IOException - If there is an error during parsing.
protected String readString()
throws IOException
IOException - If there is an error reading from the stream.
protected String readExpectedString(String theString)
throws IOException
theString - The next expected string in the stream.
IOException - If there is an error reading from the stream or theString does not match what was read.
protected String readString(int length)
throws IOException
length - The length to stop reading at.
IOException - If there is an error reading from the stream.
protected boolean isClosing()
throws IOException
IOException - If an IO error occurs.protected boolean isClosing(int c)
c - The character to check against end of line
protected String readLine()
throws IOException
IOException - If there is an error reading from the stream.
protected boolean isEOL()
throws IOException
IOException - If there is an error reading from the stream.protected boolean isEOL(int c)
c - The character to check against end of line
protected boolean isWhitespace()
throws IOException
IOException - If there is an error reading from the stream.protected boolean isWhitespace(int c)
c - The character to check against whitespace
protected void skipSpaces()
throws IOException
IOException - If there is an error reading from the stream.
protected int readInt()
throws IOException
IOException - If there is an error reading from the stream.public void addXref(PDFXref xref)
xref - The xref to add.public List getXrefs()
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||