title: Convert zip file to gzip and write to hdfs
body: <p>I have a zip file which I want to convert to gzip and write it back to the filesystem. How can I do this?</p>
  
  <p>I already have this code to compress a file to gzip:</p>
  
  <pre><code>private static void compressGzipFile(String file, String gzipFile) {
      try {
          FileInputStream fis = new FileInputStream(file);
          FileOutputStream fos = new FileOutputStream(gzipFile);
          GZIPOutputStream gzipOS = new GZIPOutputStream(fos);
          byte[] buffer = new byte[1024];
          int len;
  
          while ((len=fis.read(buffer)) != -1) {
              gzipOS.write(buffer, 0, len);
          }
  
          // Close resources
          gzipOS.close();
          fos.close();
          fis.close();
      } catch (IOException e) {
          e.printStackTrace();
      }
  }
  </code></pre>
  
  <p>Now I need code to convert the zip file into a gzip file.</p>