Pack200: newPacker() : Pack200 « java.util.jar « Java by API






Pack200: newPacker()

  

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 {
    JarFile f = new JarFile("a.jar");
    Pack200.Packer packer = Pack200.newPacker();
    OutputStream out = new FileOutputStream("a.pack");
    packer.pack(f, out);
    out.close();
  }
}

   
    
  








Related examples in the same category

1.Pack200: newUnpacker()
2.Pack200.Packer.pack(JarFile in, OutputStream out)
3.Pack200: Unpacker.unpack(InputStream in, JarOutputStream out)