org.pdfbox.pdfparser
Class PDFStreamParser

java.lang.Object
  extended byorg.pdfbox.pdfparser.BaseParser
      extended byorg.pdfbox.pdfparser.PDFStreamParser

public class PDFStreamParser
extends BaseParser

This will parse a PDF byte stream and extract operands and such.

Version:
$Revision: 1.29 $
Author:
Ben Litchfield (ben@csh.rit.edu)

Field Summary
 
Fields inherited from class org.pdfbox.pdfparser.BaseParser
DEF, ENDSTREAM
 
Constructor Summary
PDFStreamParser(COSStream stream)
          Constructor.
PDFStreamParser(InputStream stream, RandomAccessFile raf)
          Constructor that takes a stream to parse.
 
Method Summary
 List getTokens()
          This will get the tokens that were parsed from the stream.
 void parse()
          This will parse the tokens in the stream.
 
Methods inherited from class org.pdfbox.pdfparser.BaseParser
addXref, getXrefs, setDocument
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PDFStreamParser

public PDFStreamParser(InputStream stream,
                       RandomAccessFile raf)
                throws IOException
Constructor that takes a stream to parse.

Parameters:
stream - The stream to read data from.
raf - The random access file.
Throws:
IOException - If there is an error reading from the stream.

PDFStreamParser

public PDFStreamParser(COSStream stream)
                throws IOException
Constructor.

Parameters:
stream - The stream to parse.
Throws:
IOException - If there is an error initializing the stream.
Method Detail

parse

public void parse()
           throws IOException
This will parse the tokens in the stream. This will close the stream when it is finished parsing.

Throws:
IOException - If there is an error while parsing the stream.

getTokens

public List getTokens()
This will get the tokens that were parsed from the stream.

Returns:
All of the tokens in the stream.


Copyright null EGIZ - E-Government Innovation Center. All Rights Reserved.