@Test public void iterableZipInputStreamIteratesOverElementsInZupUsingLambdaSyntax() throws IOException { try (InputStream inputStream = new FileInputStream(zipFile)) { IterableZipInputStream zipInputStream = new IterableZipInputStream(inputStream); zipInputStream.forEach(entry -> { Assert.assertTrue(entry.getName().startsWith("test.file") && entry.getName().endsWith(".txt")); }); } }
@Override public void forEach(Consumer<? super ZipEntry> action) { for (ZipEntry entry : this) { action.accept(entry); } }
IterableZipInputStream extends ZipInputStream implements Iterable<ZipEntry> { @Override public void forEach(Consumer<? super ZipEntry> action) { for (ZipEntry entry : this) { action.accept(entry); } } }
IterableZipInputStream extends ZipInputStream implements Iterable<ZipEntry> { @Override public void forEach(Consumer<? super ZipEntry> action) { for (ZipEntry entry : this) { action.accept(entry); } } IterableZipInputStream(InputStream inputStream); }
IterableZipInputStream extends ZipInputStream implements Iterable<ZipEntry> { @Override public void forEach(Consumer<? super ZipEntry> action) { for (ZipEntry entry : this) { action.accept(entry); } } IterableZipInputStream(InputStream inputStream); @Override Iterator<ZipEntry> iterator(); @Override void forEach(Consumer<? super ZipEntry> action); }
IterableZipInputStream extends ZipInputStream implements Iterable<ZipEntry> { @Override public void forEach(Consumer<? super ZipEntry> action) { for (ZipEntry entry : this) { action.accept(entry); } } IterableZipInputStream(InputStream inputStream); @Override Iterator<ZipEntry> iterator(); @Override void forEach(Consumer<? super ZipEntry> action);  }