Modifier and Type | Field and Description |
---|---|
static String |
SYSPROP_DEFLATELEVEL
Compression Level System Property.
|
Modifier | Constructor and Description |
---|---|
protected |
Filter()
Constructor.
|
Modifier and Type | Method and Description |
---|---|
abstract DecodeResult |
decode(InputStream encoded,
OutputStream decoded,
COSDictionary parameters,
int index)
Decodes data, producing the original non-encoded data.
|
DecodeResult |
decode(InputStream encoded,
OutputStream decoded,
COSDictionary parameters,
int index,
DecodeOptions options)
Decodes data, with optional DecodeOptions.
|
protected abstract void |
encode(InputStream input,
OutputStream encoded,
COSDictionary parameters) |
void |
encode(InputStream input,
OutputStream encoded,
COSDictionary parameters,
int index)
Encodes data.
|
protected static ImageReader |
findImageReader(String formatName,
String errorCause)
Finds a suitable image reader for a format.
|
static int |
getCompressionLevel() |
protected COSDictionary |
getDecodeParams(COSDictionary dictionary,
int index) |
public static final String SYSPROP_DEFLATELEVEL
Deflater.DEFAULT_COMPRESSION
. To set maximum compression, use
System.setProperty(Filter.SYSPROP_DEFLATELEVEL, "9");
public abstract DecodeResult decode(InputStream encoded, OutputStream decoded, COSDictionary parameters, int index) throws 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 decodedIOException
- if the stream cannot be decodedpublic DecodeResult decode(InputStream encoded, OutputStream decoded, COSDictionary parameters, int index, DecodeOptions options) throws 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 decodingIOException
- if the stream cannot be decodedpublic final void encode(InputStream input, OutputStream encoded, COSDictionary parameters, int index) throws 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 encodedIOException
- if the stream cannot be encodedprotected abstract void encode(InputStream input, OutputStream encoded, COSDictionary parameters) throws IOException
IOException
protected COSDictionary getDecodeParams(COSDictionary dictionary, int index)
protected static ImageReader findImageReader(String formatName, 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()
Copyright © 2002–2023 The Apache Software Foundation. All rights reserved.