Java BufferedReader Read loadReaderToList(Reader reader)

Here you can find the source of loadReaderToList(Reader reader)

Description

Reads text from an open reader into a list of strings, each containing one line of the file.

License

Open Source License

Declaration

public static List<String> loadReaderToList(Reader reader) throws IOException 

Method Source Code


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

import java.io.*;

import java.util.LinkedList;
import java.util.List;

public class Main {
    /**/*from w w w . jav a  2 s  . c o m*/
     * Reads text from an open reader into a list of strings, each containing one line of the file.
     */
    public static List<String> loadReaderToList(Reader reader) throws IOException {
        List<String> outList = new LinkedList<String>();
        String line;
        BufferedReader bufferedReader = new BufferedReader(reader);
        while ((line = bufferedReader.readLine()) != null)
            outList.add(line);
        return outList;
    }
}

Related

  1. loadPathPreferencesFromFile(File inputFile)
  2. loadPrivateKeyFile(File privateKeyFile)
  3. loadQueryFromFile(String queryFile)
  4. loadQueryNodeInfo(String input_file)
  5. loadReaderFromClasspath(Class c, String filename)
  6. loadRealDataGraphFromEmbers(String fileName, String splitter)
  7. loadSentences(InputStream stream, List jsonSentences)
  8. loadSimpleTextFile(File file, int bufferSize)
  9. loadSqlFile(String path)