Here you can find the source of ungzipFile(String inputFileName, String outputFileName)
public static boolean ungzipFile(String inputFileName, String outputFileName) throws Exception
//package com.java2s; //License from project: Open Source License import java.io.File; import java.io.FileInputStream; import java.io.FileOutputStream; import java.util.zip.GZIPInputStream; public class Main { public static boolean ungzipFile(String inputFileName, String outputFileName) throws Exception { GZIPInputStream in = null; FileOutputStream out = null; try {//from w w w . j ava 2 s . c om in = new GZIPInputStream(new FileInputStream(new File( inputFileName))); out = new FileOutputStream(new File(outputFileName)); final int BUFSIZ = 102400; byte inbuf[] = new byte[BUFSIZ]; int n; while ((n = in.read(inbuf, 0, BUFSIZ)) != -1) out.write(inbuf, 0, n); return true; } catch (Exception e) { e.printStackTrace(); return false; } finally { if (in != null) in.close(); if (out != null) out.close(); } } }