code: public static long gzip(InputStream inputStream, OutputStream out) throws IOException
    {
      try (GZIPOutputStream outputStream = new GZIPOutputStream(out)) {
        final long result = ByteStreams.copy(inputStream, outputStream);
        out.flush();
        return result;
      }
      finally {
        inputStream.close();
      }
    }
docs: Copy inputStream to out while wrapping out in a GZIPOutputStream
  Closes both input and output
  
  @param inputStream The input stream to copy data from. This stream is closed
  @param out         The output stream to wrap in a GZIPOutputStream before copying. This stream is closed
  
  @return The size of the data copied
  
  @throws IOException