Sample code for 30+ languages & platforms
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

Java
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[])
  {
    boolean success = false;

    // This example assumes the Chilkat API to have been previously unlocked.
    // See Global Unlock Sample for sample code.

    CkGzip gzip = new CkGzip();

    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.");
  }
}