title: Java: Outputting text file to Console
body: <p>I'm attempting to output a text file to the console with Java. I was wondering what is the most efficient way of doing so?</p>
  
  <p>I've researched several methods however, it's difficult to discern which is the least performance impacted solution. </p>
  
  <p>Outputting a text file to the console would involve reading in each line in the file, then writing it to the console.</p>
  
  <p>Is it better to use:</p>
  
  <ol>
  <li><p>Buffered Reader with a FileReader, reading in lines and doing a bunch of system.out.println calls? </p>
  
  <pre><code>BufferedReader in = new BufferedReader(new FileReader("C:\\logs\\")); 
  while (in.readLine() != null) {
        System.out.println(blah blah blah);          
  }         
  in.close();
  </code></pre></li>
  <li><p>Scanner reading each line in the file and doing system.print calls?</p>
  
  <pre><code>while (scanner.hasNextLine()) { 
      System.out.println(blah blah blah);   
  }
  </code></pre></li>
  </ol>
  
  <p>Thanks.</p>