public abstract class Filter
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
private static org.apache.commons.logging.Log |
LOG |
static java.lang.String |
SYSPROP_DEFLATELEVEL
Compression Level System Property.
|
Modifier | Constructor and Description |
---|---|
protected |
Filter()
Constructor.
|
Modifier and Type | Method and Description |
---|---|
abstract DecodeResult |
decode(java.io.InputStream encoded,
java.io.OutputStream decoded,
COSDictionary parameters,
int index)
Decodes data, producing the original non-encoded data.
|
DecodeResult |
decode(java.io.InputStream encoded,
java.io.OutputStream decoded,
COSDictionary parameters,
int index,
DecodeOptions options)
Decodes data, with optional DecodeOptions.
|
protected abstract void |
encode(java.io.InputStream input,
java.io.OutputStream encoded,
COSDictionary parameters) |
void |
encode(java.io.InputStream input,
java.io.OutputStream encoded,
COSDictionary parameters,
int index)
Encodes data.
|
protected static javax.imageio.ImageReader |
findImageReader(java.lang.String formatName,
java.lang.String errorCause)
Finds a suitable image reader for a format.
|
static int |
getCompressionLevel() |
protected COSDictionary |
getDecodeParams(COSDictionary dictionary,
int index) |
private static final org.apache.commons.logging.Log LOG
public static final java.lang.String SYSPROP_DEFLATELEVEL
Deflater.DEFAULT_COMPRESSION
. To set maximum compression, use
System.setProperty(Filter.SYSPROP_DEFLATELEVEL, "9");
public abstract DecodeResult decode(java.io.InputStream encoded, java.io.OutputStream decoded, COSDictionary parameters, int index) throws java.io.IOException
encoded
- the encoded byte streamdecoded
- the stream where decoded data will be writtenparameters
- the parameters used for decodingindex
- the index to the filter being decodedjava.io.IOException
- if the stream cannot be decodedpublic DecodeResult decode(java.io.InputStream encoded, java.io.OutputStream decoded, COSDictionary parameters, int index, DecodeOptions options) throws java.io.IOException
honored
flag to test if they were applied.encoded
- the encoded byte streamdecoded
- the stream where decoded data will be writtenparameters
- the parameters used for decodingindex
- the index to the filter being decodedoptions
- additional options for decodingjava.io.IOException
- if the stream cannot be decodedpublic final void encode(java.io.InputStream input, java.io.OutputStream encoded, COSDictionary parameters, int index) throws java.io.IOException
input
- the byte stream to encodeencoded
- the stream where encoded data will be writtenparameters
- the parameters used for encodingindex
- the index to the filter being encodedjava.io.IOException
- if the stream cannot be encodedprotected abstract void encode(java.io.InputStream input, java.io.OutputStream encoded, COSDictionary parameters) throws java.io.IOException
java.io.IOException
protected COSDictionary getDecodeParams(COSDictionary dictionary, int index)
protected static javax.imageio.ImageReader findImageReader(java.lang.String formatName, java.lang.String errorCause) throws MissingImageReaderException
formatName
- The format to search for.errorCause
- The probably cause if something goes wrong.MissingImageReaderException
- if no image reader is found.public static int getCompressionLevel()