(Java) GZip Decompress File
Demonstrates how to uncompress a .gz compressed file to get the uncompressed original file.
import com.chilkatsoft.*;
public class ChilkatExample {
static {
try {
System.loadLibrary("chilkat");
} catch (UnsatisfiedLinkError e) {
System.err.println("Native code library failed to load.\n" + e);
System.exit(1);
}
}
public static void main(String argv[])
{
// This example assumes the Chilkat API to have been previously unlocked.
// See Global Unlock Sample for sample code.
CkGzip gzip = new CkGzip();
boolean success = gzip.UncompressFile("qa_data/gzip/something.csv.gz","qa_output/something.csv");
if (success != true) {
System.out.println(gzip.lastErrorText());
return;
}
System.out.println("File successfully uncompressed and extracted from the Gzip compressed format.");
}
}
|