public static byte[] compress(final byte[] srcTxt) throws Exception {
        try (val rstBao = new ByteArrayOutputStream(); val zos = new GZIPOutputStream(rstBao)) {
            zos.write(srcTxt);
            zos.flush();
            zos.finish();
            return rstBao.toByteArray();
        }
    }
Use {@link java.util.zip.ZipOutputStream} to zip text to byte array, then convert
byte array to base64 string, so it can be transferred via http request.

@param srcTxt the src txt
@return the byte array
core/cas-server-core-util-api/src/main/java/org/apereo/cas/util/CompressionUtils.java