Java Text File Read Line readLines(String filename)

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

Description

read Lines

License

Apache License

Declaration

public static String[] readLines(String filename) throws IOException 

Method Source Code

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

import java.io.*;
import java.util.*;

public class Main {
    public static String[] readLines(String filename) throws IOException {
        List<String> result = new ArrayList<String>();
        BufferedReader br = new BufferedReader(new FileReader(filename));
        String strLine;/*from  w ww  .  j a v  a  2  s  .  co m*/
        while ((strLine = br.readLine()) != null) {
            result.add(strLine);
        }
        br.close();
        return result.toArray(new String[result.size()]);
    }
}

Related

  1. readlines(String filename)
  2. readLines(String filename)
  3. readLines(String filename)
  4. readLines(String filename)
  5. readLines(String fileName)
  6. readLines(String fileName)
  7. readLines(String filename)
  8. readLines(String fileName)
  9. readLines(String filename)