code: public static long gunzip(InputStream in, OutputStream out) throws IOException
    {
      try (GZIPInputStream gzipInputStream = gzipInputStream(in)) {
        final long result = ByteStreams.copy(gzipInputStream, out);
        out.flush();
        return result;
      }
      finally {
        out.close();
      }
    }
docs: gunzip from the source stream to the destination stream.
  
  @param in  The input stream which is to be decompressed. This stream is closed.
  @param out The output stream to write to. This stream is closed
  
  @return The number of bytes written to the output stream.
  
  @throws IOException