Main.java Source code

Java tutorial

Introduction

Here is the source code for Main.java

Source

import java.io.FileInputStream;
import java.io.FileOutputStream;
import java.io.InputStream;
import java.util.jar.JarOutputStream;
import java.util.jar.Pack200;
import java.util.zip.GZIPInputStream;

public class Main {
    public static void main(String[] args) throws Exception {
        String inName = "a.pack.gz";
        String outName = "a.unpacked";
        Pack200.Unpacker unpacker = Pack200.newUnpacker();
        JarOutputStream out = new JarOutputStream(new FileOutputStream(outName));
        InputStream in = new FileInputStream(inName);
        in = new GZIPInputStream(in);
        unpacker.unpack(in, out);
        out.close();
    }
}