URISyntaxException {
in = new JarFile(new File(Archive.class.getResource(
"/org/apache/harmony/pack200/tests/hw.jar").toURI()));
file = File.createTempFile("helloworld", ".pack.gz");
out = new FileOutputStream(file);
PackingOptions options = new PackingOptions();
options.setSegmentLimit(0);
Archive archive = new Archive(in, out, options);
archive.pack();
in.close();
out.close();
in = new JarFile(new File(Archive.class.getResource(
"/org/apache/harmony/pack200/tests/hw.jar").toURI()));
file = File.createTempFile("helloworld", ".pack.gz");
out = new FileOutputStream(file);
options = new PackingOptions();
options.setSegmentLimit(-1);
archive = new Archive(in, out, options);
archive.pack();
in.close();
out.close();
in = new JarFile(new File(Archive.class.getResource(
"/org/apache/harmony/pack200/tests/hw.jar").toURI()));
file = File.createTempFile("helloworld", ".pack.gz");
out = new FileOutputStream(file);
options = new PackingOptions();
options.setSegmentLimit(5000);
archive = new Archive(in, out, options);
archive.pack();
in.close();
out.close();
}