private static String deflateViaStream(final String samlRequest) throws IOException {
        val xmlBytes = samlRequest.getBytes(StandardCharsets.UTF_8);
        val byteOutputStream = new ByteArrayOutputStream();
        val deflaterOutputStream = new DeflaterOutputStream(
            byteOutputStream);
        deflaterOutputStream.write(xmlBytes, 0, xmlBytes.length);
        deflaterOutputStream.close();
        return EncodingUtils.encodeBase64(byteOutputStream.toByteArray());
    }
Utility class to ensure authentication requests are properly encoded and decoded.

@author Misagh Moayyed
@since 4.1
support/cas-server-support-saml/src/test/java/org/apereo/cas/support/saml/authentication/SamlAuthenticationRequestTests.java