Java Reader Read Line readLines(final BufferedReader aReader)

Here you can find the source of readLines(final BufferedReader aReader)

Description

read Lines

License

Open Source License

Declaration

public static List<String> readLines(final BufferedReader aReader) throws IOException 

Method Source Code


//package com.java2s;
//License from project: Open Source License 

import java.io.BufferedReader;
import java.io.IOException;
import java.io.Reader;
import java.util.ArrayList;
import java.util.List;

public class Main {
    public static final List<String> readLines(final Reader aReader) throws IOException {
        return readLines(new BufferedReader(aReader));
    }/*from  w  w  w . java  2 s . co m*/

    public static List<String> readLines(final BufferedReader aReader) throws IOException {
        final ArrayList<String> lines = new ArrayList<String>();
        while (true) {
            final String line = aReader.readLine();
            if (line == null)
                break;
            lines.add(line);
        }
        return lines;
    }
}

Related

  1. readLines(BufferedReader in, StringBuilder buffer, int numLines, String lineEnd)
  2. readLines(BufferedReader reader)
  3. readLines(final Reader input)
  4. readLines(Reader in)
  5. readLines(Reader in, boolean trim)
  6. readLines(Reader input)