File file = createSingleEntryArchive(archiverName);
file.deleteOnExit();
InputStream is1 = new FileInputStream(file);
ArchiveInputStream ais1 = factory.createArchiveInputStream(archiverName, is1);
final ArchiveEntry nextEntry = ais1.getNextEntry();
assertNotNull(nextEntry);
byte [] buff = new byte[10]; // small so multiple reads are needed;
long size = nextEntry.getSize();
if (size != ArchiveEntry.SIZE_UNKNOWN) {
assertTrue("Size should be > 0, found: "+size, size > 0);
}
InputStream is2 = new FileInputStream(file);
ArchiveInputStream ais2 = factory.createArchiveInputStream(archiverName, is2);
final ArchiveEntry nextEntry2 = ais2.getNextEntry();
assertNotNull(nextEntry2);
assertEquals("Expected same entry size", size, nextEntry2.getSize());
InputStream is3 = new FileInputStream(file);
ArchiveInputStream ais3 = factory.createArchiveInputStream(archiverName, is3);
final ArchiveEntry nextEntry3 = ais3.getNextEntry();
assertNotNull(nextEntry3);
assertEquals("Expected same entry size", size, nextEntry3.getSize());
int b;
while((b=ais1.read()) != -1){
out1.write(b);
}