title: How can I improve the speed of reading big-size file in Java?
body: <p>I just read a file whose size is 167MB and line number is 1884000. The method I use is <code>BufferedReader</code> to get the effect of reading it in line. </p>
  
  <p>What I noticed is that the process of reading the file is growing slower and slower as the current line number increased (In this case, it tooks me <strong>3h30min</strong> to finish it). </p>
  
  <p>I know using <code>nio</code> may speed up this procedure, but I want to read the file in line. </p>
  
  <p>My code is as below; could anyone give me some suggestions? Thanks a lot!</p>
  
  <pre><code>String htmlContentPath = html.getAbsolutePath();
  BufferedReader reader = new  BufferedReader(new InputStreamReader(new FileInputStream(htmlContentPath)));
  String line = null;
  int cnt = 0;
  while((line = reader.readLine()) != null)       {
      this.proc(line);
      if((cnt++ % 2000) == 0) {
          logger.info("current line number:\t"+cnt);
      }
  }
  </code></pre>