Here you can find the source of readAllLines(Path path, Charset cs)
public static List<String> readAllLines(Path path, Charset cs)
//package com.java2s; //License from project: Open Source License import java.io.IOException; import java.nio.charset.Charset; import java.nio.charset.StandardCharsets; import java.nio.file.Files; import java.nio.file.Path; import java.util.List; public class Main { public static List<String> readAllLines(Path path, Charset cs) { try {/* w ww . ja va 2s .c om*/ return Files.readAllLines(path, cs); } catch (IOException e) { throw new RuntimeException(e); } } public static List<String> readAllLines(Path path) { return readAllLines(path, StandardCharsets.UTF_8); } }