code: public static byte[] compressGZIP(byte[] message) throws IOException {
          // Write data through a GZIPOutputStream into a ByteArrayOutputStream.
          ByteArrayOutputStream bytesOut = new ByteArrayOutputStream();
          GZIPOutputStream gzipOut = new GZIPOutputStream(bytesOut);
          gzipOut.write(message);
          gzipOut.finish();
          return bytesOut.toByteArray();
      }
docs: Compress the given message using GZIP, returning the compressed result as a byte[].
  
  @param  message      Message to be compressed (must be non-null and length &gt; 0).
  @return              Decompressed message.
  @throws IOException  If an error occurs such as a corrupt GZIP format.