Pack200.Packer.pack(JarFile in, OutputStream out) : Pack200 « java.util.jar « Java by API






Pack200.Packer.pack(JarFile in, OutputStream out)

   
import java.io.FileOutputStream;
import java.io.OutputStream;
import java.util.jar.JarFile;
import java.util.jar.Pack200;

public class Main {

  public static void main(String[] args) throws Exception {

    OutputStream out = null;

    JarFile f = new JarFile(args[0]);
    Pack200.Packer packer = Pack200.newPacker();
    out = new FileOutputStream(args[0] + ".pack");
    packer.pack(f, out);
    out.close();
  }
}

   
    
    
  








Related examples in the same category

1.Pack200: newPacker()
2.Pack200: newUnpacker()
3.Pack200: Unpacker.unpack(InputStream in, JarOutputStream out)