Java Text File Read Line readLines(String filename)

Here you can find the source of readLines(String filename)

Description

read Lines

License

LGPL

Declaration

public static List<String> readLines(String filename) throws IOException 

Method Source Code


//package com.java2s;
//License from project: LGPL 

import java.io.BufferedReader;

import java.io.FileReader;

import java.io.IOException;
import java.util.ArrayList;

import java.util.List;

public class Main {
    public static List<String> readLines(String filename) throws IOException {
        BufferedReader br = new BufferedReader(new FileReader(filename));
        ArrayList<String> res = new ArrayList<String>();
        while (br.ready()) {
            res.add(br.readLine());//from  w w w.j a v  a  2 s . c o m
        }
        br.close();
        return res;
    }
}

Related

  1. readLines(int problemNumber)
  2. readLines(String body)
  3. readLines(String file)
  4. readLines(String file)
  5. readLines(String file, ArrayList lines)
  6. readLines(String fileName)
  7. readlines(String filename)
  8. readLines(String filename)
  9. readLines(String filename)