java.lang.Object
org.sejda.sambox.filter.Filter
A filter for stream data.
- Author:
- Ben Litchfield, John Hewson
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionabstract DecodeResultdecode(InputStream encoded, OutputStream decoded, COSDictionary parameters, int index) Decodes data, producing the original non-encoded data.abstract voidencode(InputStream input, OutputStream encoded, COSDictionary parameters) Encodes data.protected static ImageReaderfindImageReader(String formatName, String errorCause) Finds a suitable image reader for a format.static intprotected COSDictionarygetDecodeParams(COSDictionary dictionary, int index)
-
Field Details
-
SYSPROP_DEFLATELEVEL
Compression Level System Property. Set this to a value from 0 to 9 to change the zlib deflate compression level used to compress /Flate streams. The default value is -1 which isDeflater.DEFAULT_COMPRESSION. To set maximum compression, useSystem.setProperty(Filter.SYSPROP_DEFLATELEVEL, "9");- See Also:
-
-
Constructor Details
-
Filter
protected Filter()
-
-
Method Details
-
decode
public abstract DecodeResult decode(InputStream encoded, OutputStream decoded, COSDictionary parameters, int index) throws IOException Decodes data, producing the original non-encoded data.- Parameters:
encoded- the encoded byte streamdecoded- the stream where decoded data will be writtenparameters- the parameters used for decodingindex- the index to the filter being decoded- Returns:
- repaired parameters dictionary, or the original parameters dictionary
- Throws:
IOException- if the stream cannot be decoded
-
encode
public abstract void encode(InputStream input, OutputStream encoded, COSDictionary parameters) throws IOException Encodes data.- Parameters:
input- the byte stream to encodeencoded- the stream where encoded data will be writtenparameters- the parameters used for encoding- Throws:
IOException- if the stream cannot be encoded
-
getDecodeParams
-
findImageReader
protected static ImageReader findImageReader(String formatName, String errorCause) throws MissingImageReaderException Finds a suitable image reader for a format.- Parameters:
formatName- The format to search for.errorCause- The probably cause if something goes wrong.- Returns:
- The image reader for the format.
- Throws:
MissingImageReaderException- if no image reader is found.
-
getCompressionLevel
public static int getCompressionLevel()- Returns:
- the ZIP compression level configured for PDFBox
-