private static List < String > readAllLines ( File f ) throws IOException { BufferedReader r = new BufferedReader ( new FileReader ( f ) ) ; try { List < String > result = new ArrayList < String > ( ) ; String line ; while ( ( line = r . readLine ( ) ) != null ) { result . add ( line ) ; } return result ; } finally { r . close ( ) ; } }
Reads all lines of a file with the platform encoding .