Here you can find the source of gunzip(String inFile, String outFile)
public static void gunzip(String inFile, String outFile)
//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 gunzip(String inFile, String outFile) { byte[] buffer = new byte[1024]; try {/*w w w .j a va 2s . c o m*/ System.out.println("Gunzip..."); GZIPInputStream gzis = new GZIPInputStream(new FileInputStream(inFile)); FileOutputStream out = new FileOutputStream(outFile); int len; while ((len = gzis.read(buffer)) > 0) { out.write(buffer, 0, len); } gzis.close(); out.close(); System.out.println("Done"); } catch (IOException ex) { ex.printStackTrace(); } } }