@Test
public void testDirectoryZipInputStream() throws IOException {

    createDirectoryZip();
    File inputStreamFile = File.createTempFile("dirzip-input", null);
    FileInputStream fileInputStream = new FileInputStream(inputStreamFile);
    DirectoryZipInputStream directoryZipInputStream = new DirectoryZipInputStream(outputDirectory);
    ZipEntry zipEntry = null;
    int directoriesFound = 0;
    int filesRead = 0;
    long bytesRead = 0;
    List<String> entryNamesFound = new ArrayList<String>();
    while ((zipEntry = directoryZipInputStream.getNextEntry()) != null) {
        entryNamesFound.add(zipEntry.getName().replace('\\', '/'));
        if (zipEntry.isDirectory()) {
            directoriesFound++;
        } else {
            filesRead++;
            byte[] fileContents = IOUtils.toByteArray(directoryZipInputStream);
            bytesRead += fileContents.length;
        }
    }
    Assert.assertEquals("Bytes read does not match bytes written", bytesWritten, bytesRead);
    Assert.assertEquals("Number of files read does not match number of files created", filesCreated, filesRead);
    Assert.assertEquals("Directories found does not match number of directories created", directoriesCreated, directoriesFound);
    Assert.assertEquals("Number of entry names does not match !", entryNames.size(), entryNamesFound.size());
    Assert.assertTrue("Entry names do not match !", CollectionUtils.isEqualCollection(entryNames, entryNamesFound));
    fileInputStream.close();
    inputStreamFile.delete();
}