Here you can find the source of readFileToList(String fileName, String codeing)
public static List<String> readFileToList(String fileName, String codeing)
//package com.java2s; import java.io.BufferedReader; import java.io.FileInputStream; import java.io.InputStreamReader; import java.util.ArrayList; import java.util.List; public class Main { public static List<String> readFileToList(String fileName, String codeing) { List<String> list = new ArrayList<String>(); try {/*from w w w . j a v a 2 s .c om*/ BufferedReader reader = new BufferedReader( new InputStreamReader(new FileInputStream(fileName), codeing)); String data = null; do { data = reader.readLine(); if (data == null) break; else { list.add(data); } } while (true); } catch (Exception ex) { ex.printStackTrace(); } return list; } }