Here you can find the source of unzip(String inFilePath)
public static String unzip(String inFilePath) throws FileNotFoundException, IOException
//package com.java2s; //License from project: Open Source License import java.io.FileInputStream; import java.io.FileNotFoundException; import java.io.FileOutputStream; import java.io.IOException; import java.io.OutputStream; import java.util.zip.GZIPInputStream; public class Main { public static String unzip(String inFilePath) throws FileNotFoundException, IOException { GZIPInputStream gzipInputStream = new GZIPInputStream(new FileInputStream(inFilePath)); String outFilePath = inFilePath.replace(".gz", ""); OutputStream out = new FileOutputStream(outFilePath); byte[] buf = new byte[1024]; int len;/*w ww. ja v a 2 s.c o m*/ while ((len = gzipInputStream.read(buf)) > 0) out.write(buf, 0, len); gzipInputStream.close(); out.close(); //new File(inFilePath).delete(); return outFilePath; } }