Java BufferedReader Read readFile(String filename)

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

Description

read File

License

Open Source License

Declaration

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

Method Source Code


//package com.java2s;

import java.io.BufferedReader;

import java.io.File;
import java.io.FileReader;
import java.io.IOException;

import java.util.ArrayList;

import java.util.List;

public class Main {
    public static List<String> readFile(String filename) throws IOException {
        return readFile(new File(filename));
    }/*from  www  .  j  a  va2s. c o m*/

    public static List<String> readFile(File file) throws IOException {
        List<String> lines = new ArrayList<String>();
        BufferedReader in = new BufferedReader(new FileReader(file));
        String line;
        while ((line = in.readLine()) != null)
            lines.add(line);
        return lines;
    }
}

Related

  1. readFile(String fileName)
  2. readFile(String filename)
  3. readFile(String filename)
  4. readFile(String filename)
  5. readFile(String fileName)
  6. readFile(String fileName)
  7. readfile(String filename)
  8. readFile(String filename)
  9. readFile(String fileName)