Here you can find the source of decompressGzipFile(String gzipFile, String newFile)
public static void decompressGzipFile(String gzipFile, String newFile)
//package com.java2s; //License from project: Open Source License import java.io.FileInputStream; import java.io.FileOutputStream; import java.io.IOException; import java.util.zip.GZIPInputStream; public class Main { public static void decompressGzipFile(String gzipFile, String newFile) { try {/* w ww.j a v a 2s .co m*/ FileInputStream fis = new FileInputStream(gzipFile); GZIPInputStream gis = new GZIPInputStream(fis); FileOutputStream fos = new FileOutputStream(newFile); byte[] buffer = new byte[1024]; int len; while ((len = gis.read(buffer)) != -1) { fos.write(buffer, 0, len); } // close resources fos.close(); gis.close(); } catch (IOException e) { e.printStackTrace(); } } }