code: String deflateAndBase64Encode(SAMLObject message) throws MessageEncodingException {
          log.debug("Deflating and Base64 encoding SAML message");
          try {
              String messageStr = SerializeSupport.nodeToString(marshallMessage(message));
              log.trace("Output XML message: {}", messageStr);
  
              ByteArrayOutputStream bytesOut = new ByteArrayOutputStream();
              Deflater deflater = new Deflater(Deflater.DEFLATED, true);
              DeflaterOutputStream deflaterStream = new DeflaterOutputStream(bytesOut, deflater);
              deflaterStream.write(messageStr.getBytes(StandardCharsets.UTF_8));
              deflaterStream.finish();
  
              return Base64Support.encode(bytesOut.toByteArray(), Base64Support.UNCHUNKED);
          } catch (IOException e) {
              throw new MessageEncodingException("Unable to DEFLATE and Base64 encode SAML message", e);
          }
      }
docs: DEFLATE (RFC1951) compresses the given SAML message.
  
  @param message SAML message
  
  @return DEFLATE compressed message
  
  @throws MessageEncodingException thrown if there is a problem compressing the message