public void testArjUnarchive() throws Exception {
final StringBuilder expected = new StringBuilder();
expected.append("test1.xml<?xml version="1.0"?>
");
expected.append("<empty/>test2.xml<?xml version="1.0"?>
");
expected.append("<empty/>
");
final ArjArchiveInputStream in = new ArjArchiveInputStream(new FileInputStream(getFile("bla.arj")));
ArjArchiveEntry entry;
final StringBuilder result = new StringBuilder();
while ((entry = in.getNextEntry()) != null) {
result.append(entry.getName());
int tmp;
while ((tmp = in.read()) != -1) {
result.append((char) tmp);
}
assertFalse(entry.isDirectory());
}
in.close();
assertEquals(result.toString(), expected.toString());
}
|