protected InputStream internalInflate(final byte[] input, final Inflater inflater) throws IOException {
        val baos = new ByteArrayOutputStream();
        val iis = new InflaterInputStream(new ByteArrayInputStream(input), inflater);
        try {
            val buffer = new byte[1000];
            int length;
            while ((length = iis.read(buffer)) > 0) {
                baos.write(buffer, 0, length);
            }
            val decodedBytes = baos.toByteArray();
            val decodedMessage = new String(decodedBytes, StandardCharsets.UTF_8);
            LOGGER.debug("Inflated SAML message: {}", decodedMessage);
            return new ByteArrayInputStream(decodedBytes);
        } finally {
            baos.close();
            iis.close();
        }
    }
<p>internalInflate.</p>

@param input an array of {@link byte} objects
@param inflater a {@link Inflater} object
@return a {@link InputStream} object
@throws IOException if any.
pac4j-saml/src/main/java/org/pac4j/saml/transport/Pac4jHTTPRedirectDeflateDecoder.java