Java
Chilkat2 Java
GZip Decompress File
See more Gzip Examples
Demonstrates how to uncompress a .gz compressed file to get the uncompressed original file.Chilkat Java Downloads
import com.chilkatsoft.chilkat2.ChilkatException;
import com.chilkatsoft.chilkat2.Gzip;
public class ChilkatExample {
public static void main(String[] args) {
// This example assumes the Chilkat API to have been previously unlocked.
// See Global Unlock Sample for sample code.
Gzip gzip = new Gzip();
try {
gzip.uncompressFile("qa_data/gzip/something.csv.gz", "qa_output/something.csv");
} catch (ChilkatException e) {
System.out.println(e.getLastErrorText());
return;
}
System.out.println("File successfully uncompressed and extracted from the Gzip compressed format.");
}
}