Class FlateDecodeFilter

    • Constructor Detail

      • FlateDecodeFilter

        public FlateDecodeFilter()
    • Method Detail

      • 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,
                                                    java.io.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
      • getNumberOrDefault

        private static int getNumberOrDefault​(PdfDictionary dict,
                                              PdfName key,
                                              int defaultInt)