public void testConsumesArchiveCompletely() throws Exception {
final InputStream is = DumpArchiveInputStreamTest.class
.getResourceAsStream("/archive_with_trailer.dump");
final DumpArchiveInputStream dump = new DumpArchiveInputStream(is);
while (dump.getNextDumpEntry() != null) {
}
final byte[] expected = new byte[] {
'H', 'e', 'l', 'l', 'o', ',', ' ', 'w', 'o', 'r', 'l', 'd', '!', '
'
};
final byte[] actual = new byte[expected.length];
is.read(actual);
assertArrayEquals(expected, actual);
dump.close();
}
|