Here you can find the source of fileToLines(String filename)
private static List<String> fileToLines(String filename)
//package com.java2s; //License from project: Open Source License import java.io.*; import java.util.*; public class Main { private static List<String> fileToLines(String filename) { List<String> lines = new LinkedList<String>(); String line = ""; try {//w w w . ja va 2s. c o m BufferedReader in = new BufferedReader(new FileReader(filename)); while ((line = in.readLine()) != null) { lines.add(line); } } catch (IOException e) { e.printStackTrace(); } return lines; } }