Package com.itextpdf.kernel.pdf.filters
Class FlateDecodeFilter
java.lang.Object
com.itextpdf.kernel.pdf.MemoryLimitsAwareFilter
com.itextpdf.kernel.pdf.filters.FlateDecodeFilter
- All Implemented Interfaces:
-
IFilterHandler
- Direct Known Subclasses:
-
FlateDecodeStrictFilter
Handles FlateDecode filter.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbyte[]decode(byte[] b, PdfName filterName, PdfObject decodeParams, PdfDictionary streamDictionary) Decode the byte[] using the provided filterName.static byte[]decodePredictor(byte[] in, PdfObject decodeParams) static byte[]flateDecode(byte[] in, boolean strict) A helper to flateDecode.protected static byte[]flateDecodeInternal(byte[] in, boolean strict, ByteArrayOutputStream out) A helper to flateDecode.Methods inherited from class com.itextpdf.kernel.pdf.MemoryLimitsAwareFilter
enableMemoryLimitsAwareHandler
-
Constructor Details
-
FlateDecodeFilter
public FlateDecodeFilter()
-
-
Method Details
-
flateDecode
public static byte[] flateDecode(byte[] in, boolean strict) A helper to flateDecode.- Parameters:
-
in- the input data -
strict-trueto read a correct stream.falseto try to read a corrupted stream. - Returns:
- the decoded data
-
decodePredictor
- Parameters:
-
in- Input byte array. -
decodeParams- PdfDictionary of decodeParams. - Returns:
- a byte array
-
decode
public byte[] decode(byte[] b, PdfName filterName, PdfObject decodeParams, PdfDictionary streamDictionary) Decode the byte[] using the provided filterName.- Parameters:
-
b- the bytes that need to be decoded -
filterName- PdfName of the filter -
decodeParams- decode parameters -
streamDictionary- the dictionary of the stream. Can contain additional information needed to decode the byte[]. - Returns:
- decoded byte array
-
flateDecodeInternal
A helper to flateDecode.- Parameters:
-
in- the input data -
strict-trueto read a correct stream.falseto try to read a corrupted stream. -
out- the out stream which will be used to write the bytes. - Returns:
- the decoded data
-