Java Utililty Methods BufferedReader Read Line

List of utility methods to do BufferedReader Read Line

Description

The list of methods to do BufferedReader Read Line are organized into topic(s).

Method

voidreadLineByLine(File file, char[][] terminators, boolean keepTerminators, Consumer readLineListener)
Reads a file line by line using some supplied terminators to define when a line ends.
try {
    StringBuilder sb = new StringBuilder();
    FileReader fr = new FileReader(file);
    BufferedReader br = new BufferedReader(fr);
    String line;
    while ((line = readUntil(br, terminators, sb, keepTerminators)) != null) {
        readLineListener.accept(line);
} catch (IOException e) {
    e.printStackTrace();
String[]readLineFile(File file)
read Line File
BufferedReader a = null;
String[] d = null;
try {
    a = new BufferedReader(new FileReader(file));
    String b;
    int c = 0;
    String[] e = null;
    b = a.readLine();
...
StringreadLineFile(String filePath)
read Line File
StringBuffer sb = new StringBuffer();
FileReader fr = new FileReader(filePath);
BufferedReader br = new BufferedReader(fr);
String line = br.readLine();
while (line != null) {
    sb.append(line);
    line = br.readLine();
br.close();
fr.close();
return sb.toString();
StringreadLineFromCommand(String command[])
read Line From Command
List<String> lines = new LinkedList<String>();
int exitCode = readLinesFromCommand(command, lines);
if (lines.isEmpty()) {
    return null;
return lines.get(0);
StringreadLineFromConsole()
read Line From Console
try {
    BufferedReader bufferRead = new BufferedReader(new InputStreamReader(System.in));
    String line = bufferRead.readLine();
    return line;
} catch (IOException e) {
    e.printStackTrace();
    return null;
StringreadLineHard(BufferedReader in)
read Line Hard
try {
    return in.readLine();
} catch (IOException e) {
    throw new RuntimeException(e);
ArrayListreadLineList(String fileName)
read Line List
BufferedReader in = new BufferedReader(new InputStreamReader(new FileInputStream(fileName), "UTF-8"));
ArrayList<String> fin = new ArrayList();
for (;;) {
    String k1 = in.readLine();
    if (k1 == null)
        break;
    fin.add(k1);
return fin;
ListreadLineToList(String pathName, String enCoding)
read Line To List
BufferedReader br = null;
String line = "";
List<String> lines = new ArrayList<String>();
br = readToBufferedReader(pathName, enCoding);
if (null == br) {
    return null;
try {
...