Class FlateDecodeFilter

java.lang.Object
com.itextpdf.kernel.pdf.MemoryLimitsAwareFilter
com.itextpdf.kernel.pdf.filters.FlateDecodeFilter
All Implemented Interfaces:
IFilterHandler
Direct Known Subclasses:
FlateDecodeStrictFilter

public class FlateDecodeFilter extends MemoryLimitsAwareFilter
Handles FlateDecode filter.
  • 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 - true to read a correct stream. false to try to read a corrupted stream.
      Returns:
      the decoded data
    • decodePredictor

      public static byte[] decodePredictor (byte[] in, PdfObject decodeParams)
      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

      protected static byte[] flateDecodeInternal (byte[] in, boolean strict, ByteArrayOutputStream out)
      A helper to flateDecode.
      Parameters:
      in - the input data
      strict - true to read a correct stream. false to try to read a corrupted stream.
      out - the out stream which will be used to write the bytes.
      Returns:
      the decoded data