package be.iminds.ilabt.jfed.log.cache;

import java.io.FileInputStream;
import java.io.FileOutputStream;
import java.io.IOException;
import java.util.zip.InflaterInputStream;

/**
 * User: twalcari
 * Date: 6/3/2014
 * Time: 11:03
 */
public class Inflater {

    public static void main(String[] args) {

        if (args.length != 2)
            System.out.println("Two arguments required: INPUT OUTPUT");
        try {

            FileInputStream fis = new FileInputStream(args[0]);
            FileOutputStream fos = new FileOutputStream(args[1]);
            InflaterInputStream dflIn = new InflaterInputStream(fis);


            int c;
            while ((c = dflIn.read()) != -1) {
                fos.write(c);
            }
            dflIn.close();

            fos.close();
        } catch (IOException e) {
            e.printStackTrace();
        }
    }


}
