code: private void maybeEnableCompression() throws SmackException, InterruptedException {
          if (!config.isCompressionEnabled()) {
              return;
          }
  
          Compress.Feature compression = getFeature(Compress.Feature.ELEMENT, Compress.NAMESPACE);
          if (compression == null) {
              // Server does not support compression
              return;
          }
          // If stream compression was offered by the server and we want to use
          // compression then send compression request to the server
          if ((compressionHandler = maybeGetCompressionHandler(compression)) != null) {
              compressSyncPoint.sendAndWaitForResponseOrThrow(new Compress(compressionHandler.getCompressionMethod()));
          } else {
              LOGGER.warning("Could not enable compression because no matching handler/method pair was found");
          }
      }
docs: <p>
  Starts using stream compression that will compress network traffic. Traffic can be
  reduced up to 90%. Therefore, stream compression is ideal when using a slow speed network
  connection. However, the server and the client will need to use more CPU time in order to
  un/compress network data so under high load the server performance might be affected.
  </p>
  <p>
  Stream compression has to have been previously offered by the server. Currently only the
  zlib method is supported by the client. Stream compression negotiation has to be done
  before authentication took place.
  </p>
  
  @throws NotConnectedException
  @throws SmackException
  @throws NoResponseException
  @throws InterruptedException