final File file1 = getFile("test1.xml");
final File file2 = getFile("test2.xml");
final OutputStream out =
new Pack200CompressorOutputStream(new FileOutputStream(output),
mode);
try {
final ArchiveOutputStream os = new ArchiveStreamFactory()
.createArchiveOutputStream("jar", out);
os.putArchiveEntry(new ZipArchiveEntry("testdata/test1.xml"));
IOUtils.copy(new FileInputStream(file1), os);
os.closeArchiveEntry();
os.putArchiveEntry(new ZipArchiveEntry("testdata/test2.xml"));
IOUtils.copy(new FileInputStream(file2), os);
os.closeArchiveEntry();
os.close();
} finally {
out.close();
}
final InputStream is = new Pack200CompressorInputStream(output);
try {
final ArchiveInputStream in = new ArchiveStreamFactory()