|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.pdfbox.pdmodel.common.PDStream
public class PDStream
A PDStream represents a stream in a PDF document. Streams are tied to a single PDF document.
| Constructor Summary | |
|---|---|
protected |
PDStream()
This will create a new PDStream object. |
|
PDStream(COSStream str)
Constructor. |
|
PDStream(PDDocument document)
This will create a new PDStream object. |
|
PDStream(PDDocument doc,
java.io.InputStream str)
Constructor. |
|
PDStream(PDDocument doc,
java.io.InputStream str,
boolean filtered)
Constructor. |
| Method Summary | |
|---|---|
void |
addCompression()
If there are not compression filters on the current stream then this will add a compression filter, flate compression for example. |
static PDStream |
createFromCOS(COSBase base)
Create a pd stream from either a regular COSStream on a COSArray of cos streams. |
java.io.InputStream |
createInputStream()
This will get a stream that can be read from. |
java.io.OutputStream |
createOutputStream()
This will get a stream that can be written to. |
byte[] |
getByteArray()
This will copy the stream into a byte array. |
COSBase |
getCOSObject()
Convert this standard java object to a COS object. |
java.util.List |
getDecodeParams()
Get the list of decode parameters. |
PDFileSpecification |
getFile()
This will get the file specification for this stream. |
java.util.List |
getFileDecodeParams()
Get the list of decode parameters. |
java.util.List |
getFileFilters()
This will get the list of filters that are associated with this stream. |
java.util.List |
getFilters()
This will get the list of filters that are associated with this stream. |
java.lang.String |
getInputStreamAsString()
A convenience method to get this stream as a string. |
int |
getLength()
This will get the length of the filtered/compressed stream. |
PDMetadata |
getMetadata()
Get the metadata that is part of the document catalog. |
java.io.InputStream |
getPartiallyFilteredStream(java.util.List stopFilters)
This will get a stream with some filters applied but not others. |
COSStream |
getStream()
Get the cos stream associated with this object. |
void |
setDecodeParams(java.util.List decodeParams)
This will set the list of decode params. |
void |
setFile(PDFileSpecification f)
Set the file specification. |
void |
setFileDecodeParams(java.util.List decodeParams)
This will set the list of decode params. |
void |
setFileFilters(java.util.List filters)
This will set the filters that are part of this stream. |
void |
setFilters(java.util.List filters)
This will set the filters that are part of this stream. |
void |
setMetadata(PDMetadata meta)
Set the metadata for this object. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
protected PDStream()
public PDStream(PDDocument document)
document - The document that the stream will be part of.public PDStream(COSStream str)
str - The stream parameter.
public PDStream(PDDocument doc,
java.io.InputStream str)
throws java.io.IOException
doc - The document that will hold the stream.str - The stream parameter.
java.io.IOException - If there is an error creating the stream in the document.
public PDStream(PDDocument doc,
java.io.InputStream str,
boolean filtered)
throws java.io.IOException
doc - The document that will hold the stream.str - The stream parameter.filtered - True if the stream already has a filter applied.
java.io.IOException - If there is an error creating the stream in the document.| Method Detail |
|---|
public void addCompression()
public static PDStream createFromCOS(COSBase base)
throws java.io.IOException
base - Either a COSStream or COSArray.
java.io.IOException - If there is an error creating the PDStream.public COSBase getCOSObject()
getCOSObject in interface COSObjectable
public java.io.OutputStream createOutputStream()
throws java.io.IOException
java.io.IOException - If an IO error occurs during writing.
public java.io.InputStream createInputStream()
throws java.io.IOException
java.io.IOException - If an IO error occurs during reading.
public java.io.InputStream getPartiallyFilteredStream(java.util.List stopFilters)
throws java.io.IOException
stopFilters - A list of filters to stop decoding at.
java.io.IOException - If there is an error processing the stream.public COSStream getStream()
public int getLength()
public java.util.List getFilters()
public void setFilters(java.util.List filters)
filters - The filters that are part of this stream.
public java.util.List getDecodeParams()
throws java.io.IOException
java.io.IOException - if there is an error retrieving the parameters.public void setDecodeParams(java.util.List decodeParams)
decodeParams - The list of decode params.
public PDFileSpecification getFile()
throws java.io.IOException
java.io.IOException - If there is an error creating the file spec.public void setFile(PDFileSpecification f)
f - The file specification.public java.util.List getFileFilters()
public void setFileFilters(java.util.List filters)
filters - The filters that are part of this stream.
public java.util.List getFileDecodeParams()
throws java.io.IOException
java.io.IOException - if there is an error retrieving the parameters.public void setFileDecodeParams(java.util.List decodeParams)
decodeParams - The list of decode params.
public byte[] getByteArray()
throws java.io.IOException
java.io.IOException - When getFilteredStream did not work
public java.lang.String getInputStreamAsString()
throws java.io.IOException
java.io.IOException - if there is an error while converting the stream
to a string.public PDMetadata getMetadata()
public void setMetadata(PDMetadata meta)
meta - The meta data for this object.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||