How to read file using Files.newBufferedReader?


In the snippet below you’ll learn to open file for reading using Files.newBufferedReader() method in JDK 7. This method returns a java.io.BufferedReader which makes a backward compatibility with the old I/O system in Java.

To read a file you’ll need to provide a Path and the Charset to the newBufferedReader() method arguments.

Filed in: Java IO
© 2014 Java Examples - Built with love by Wayan Saryada.