title: Reading zip file efficiently in Java
body: <p>I working on a project which works on a very large amount of data.
  I have a lot(thousands) of zip files, each containing ONE simple txt file with thousands of lines(about 80k lines).
  What I am currently doing is the following:</p>
  
  <pre><code>for(File zipFile: dir.listFiles()){
  ZipFile zf = new ZipFile(zipFile);
  ZipEntry ze = (ZipEntry) zf.entries().nextElement();
  BufferedReader in = new BufferedReader(new InputStreamReader(zf.getInputStream(ze)));
  ...
  </code></pre>
  
  <p>In this way I can read the file line by line, but it is definetely too slow.
  Given the large number of files and lines that need to be read, I need to read them in a more efficient way.</p>
  
  <p>I have looked for a different approach, but I haven't been able to find anything.
  What I think I should use are the java nio APIs intended right for intensive I/O operations, but I don't know how to use them with zip files.</p>
  
  <p>Any help would really be appreciated.</p>
  
  <p>Thanks,</p>
  
  <p>Marco</p>