A PDStream represents a stream in a PDF document. Streams are tied to a single
PDF document.
Method from org.apache.pdfbox.pdmodel.common.PDMemoryStream Detail: |
public void addCompression() {
//no compression to add
}
If there are not compression filters on the current stream then this
will add a compression filter, flate compression for example. |
public InputStream createInputStream() throws IOException {
return new ByteArrayInputStream( data );
}
This will get a stream that can be read from. |
public OutputStream createOutputStream() throws IOException {
throw new UnsupportedOperationException( "not supported for memory stream" );
}
This will get a stream that can be written to. |
public byte[] getByteArray() throws IOException {
return data;
}
This will copy the stream into a byte array. |
public COSBase getCOSObject() {
throw new UnsupportedOperationException( "not supported for memory stream" );
}
Convert this standard java object to a COS object. |
public List getDecodeParams() throws IOException {
return null;
}
Get the list of decode parameters. Each entry in the list will refer to
an entry in the filters list. |
public PDFileSpecification getFile() {
return null;
}
This will get the file specification for this stream. This is only
required for external files. |
public List getFileDecodeParams() throws IOException {
return null;
}
Get the list of decode parameters. Each entry in the list will refer to
an entry in the filters list. |
public List getFileFilters() {
return null;
}
This will get the list of filters that are associated with this stream. Or
null if there are none. |
public List getFilters() {
return null;
}
This will get the list of filters that are associated with this stream. Or
null if there are none. |
public int getLength() {
return data.length;
}
This will get the length of the filtered/compressed stream. This is readonly in the
PD Model and will be managed by this class. |
public PDMetadata getMetadata() {
return null;
}
Get the metadata that is part of the document catalog. This will
return null if there is no meta data for this object. |
public InputStream getPartiallyFilteredStream(List stopFilters) throws IOException {
return createInputStream();
}
This will get a stream with some filters applied but not others. This is useful
when doing images, ie filters = [flate,dct], we want to remove flate but leave dct |
public COSStream getStream() {
throw new UnsupportedOperationException( "not supported for memory stream" );
}
Get the cos stream associated with this object. |
public void setDecodeParams(List decodeParams) {
//do nothing
}
This will set the list of decode params. |
public void setFile(PDFileSpecification f) {
//do nothing.
}
Set the file specification. |
public void setFileDecodeParams(List decodeParams) {
//do nothing
}
This will set the list of decode params. |
public void setFileFilters(List filters) {
//do nothing.
}
This will set the filters that are part of this stream. |
public void setFilters(List filters) {
throw new UnsupportedOperationException( "not supported for memory stream" );
}
This will set the filters that are part of this stream. |
public void setMetadata(PDMetadata meta) {
//do nothing
}
Set the metadata for this object. This can be null. |