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);
Archive archive = new Archive(in, out, true);
archive.setSegmentLimit(0);
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);
archive = new Archive(in, out, true);
archive.setSegmentLimit(-1);
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);
archive = new Archive(in, out, true);
archive.setSegmentLimit(5000);
archive.pack();
in.close();
out.close();
}