code: protected byte[] compress(final byte[] in) {
          if (in == null) {
              throw new NullPointerException("Can't compress null");
          }
  
          ByteArrayOutputStream bos = new ByteArrayOutputStream();
          GZIPOutputStream gz = null;
  
          try {
              gz = new GZIPOutputStream(bos);
              gz.write(in);
          } catch (IOException e) {
              throw new RuntimeException("IO exception compressing data", e);
          } finally {
              close(gz);
              close(bos);
          }
  
          return bos.toByteArray();
      }
docs: Compress the given array of bytes.
  
  @param in
  data to compress