0

How to count number files in an existing archive with java nio 2, without iterate. is a property like length() or size() exists ? Like :

try (ZipFile zip = new ZipFile("my.zip")) {
    size = zip.size();
}

Thanks

Mohammed
  • 89
  • 1
  • 3
  • 12
  • 2
    You ask for NIO 2 *(added in Java 7)*, so why do you use the age-old IO (not NIO or NIO 2) class [`java.util.zip.ZipFile`](https://docs.oracle.com/javase/8/docs/api/java/util/zip/ZipFile.html)? – Andreas Nov 22 '16 at 23:50
  • It's just an example, i want the equivalent to get size of archive with nio 2 – Mohammed Nov 23 '16 at 10:20

0 Answers0