Java examples for java.io:File UTF
read UTF-8 File to Line List
import java.io.BufferedReader; import java.io.File; import java.io.FileInputStream; import java.io.IOException; import java.io.InputStreamReader; import java.util.ArrayList; import java.util.List; public class Main { public static void main(String[] argv) throws IOException { File f = new File("Main.java"); System.out.println(readFileLines(f)); }/* w w w . j a v a2 s . c o m*/ public static List<String> readFileLines(File f) throws IOException { BufferedReader in = new BufferedReader(new InputStreamReader(new FileInputStream(f), "UTF-8")); List<String> list = new ArrayList<String>(); String line; while ((line = in.readLine()) != null) { list.add(line); } in.close(); return list; } }