|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object gnu.jpdf.PDFObject gnu.jpdf.PDFStream
public class PDFStream
This class implements a PDF stream object. In PDF, streams contain data like the graphic operators that render a page, or the pixels of an image.
In PDF, a stream can be compressed using several different methods, or left uncompressed. Here we support both uncompressed, and FlateDecode as it's supported by the java core.
Field Summary |
---|
Fields inherited from class gnu.jpdf.PDFObject |
---|
objser, pdfDocument |
Constructor Summary | |
---|---|
PDFStream()
Constructs a plain stream. |
|
PDFStream(java.lang.String type)
Constructs a stream. |
Method Summary | |
---|---|
boolean |
getDeflate()
Returs true if the stream will be compressed. |
java.io.OutputStream |
getOutputStream()
Returns the OutputStream that will append to this stream. |
java.io.ByteArrayOutputStream |
getStream()
This is for extenders, and provides access to the stream. |
java.io.PrintWriter |
getWriter()
Creates a PrintWriter that will append to this stream. |
void |
setDeflate(boolean mode)
|
void |
write(java.io.OutputStream os)
Writes the object to the output stream. |
void |
writeStream(java.io.OutputStream os)
This inserts the Streams length, then the actual stream, finally the end of stream/object markers. |
Methods inherited from class gnu.jpdf.PDFObject |
---|
getPDFDocument, getSerialID, getType, toArray, toString, writeEnd, writeStart |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public PDFStream()
By default, the stream will be compressed.
public PDFStream(java.lang.String type)
By default, the stream will be compressed.
type
- type for the streamPDFImage
Method Detail |
---|
public void setDeflate(boolean mode)
mode
- true will FlatDecode the streampublic boolean getDeflate()
public java.io.OutputStream getOutputStream()
public java.io.PrintWriter getWriter()
public java.io.ByteArrayOutputStream getStream()
public void write(java.io.OutputStream os) throws java.io.IOException
PDFObject
Writes the object to the output stream. This method must be overidden.
Note: It should not write any other objects, even if they are it's Kids, as they will be written by the calling routine.
write
in class PDFObject
os
- OutputStream to send the object to
java.io.IOException
- on errorpublic void writeStream(java.io.OutputStream os) throws java.io.IOException
This is intended for anyone extending PDFStream, as objects containing streams do no use writeEnd(), and they must be able to write the actual stream.
os
- OutputStream to send the object to
java.io.IOException
- on error
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |