Java InputStreamReader Read readFile(String fileFullPath)

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

Description

read File

License

Open Source License

Declaration

public static List<String> readFile(String fileFullPath) 

Method Source Code


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

import java.io.BufferedReader;

import java.io.File;
import java.io.FileInputStream;

import java.io.InputStreamReader;
import java.util.ArrayList;
import java.util.List;

public class Main {
    public static List<String> readFile(String fileFullPath) {
        List<String> retList = new ArrayList<String>();
        try {/*w w  w.j  a  v a  2 s.c  o  m*/
            File inputFlie = new File(fileFullPath);

            InputStreamReader reader = new InputStreamReader(new FileInputStream(inputFlie));
            BufferedReader br = new BufferedReader(reader);
            String line = "";
            line = br.readLine();
            while (line != null) {
                retList.add(line);
                line = br.readLine();
            }
            br.close();

        } catch (Exception e) {
            e.printStackTrace();
        }
        return retList;
    }
}

Related

  1. readFile(String file)
  2. readFile(String file)
  3. readFile(String file)
  4. readFile(String file, String charset)
  5. readFile(String file, String lineBreak)
  6. readFile(String fileName)
  7. readFile(String filename)
  8. readFile(String fileName)
  9. readFile(String filename)