Java BufferedReader Read Line readLineFile(String filePath)

Here you can find the source of readLineFile(String filePath)

Description

read Line File

License

Apache License

Declaration

public static String readLineFile(String filePath) throws IOException 

Method Source Code


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

import java.io.*;

public class Main {

    public static String readLineFile(String filePath) throws IOException {
        StringBuffer sb = new StringBuffer();
        FileReader fr = new FileReader(filePath);
        BufferedReader br = new BufferedReader(fr);
        String line = br.readLine();
        while (line != null) {
            sb.append(line);/*from  w  w  w.j  a v a2  s . c  o m*/
            line = br.readLine();
        }
        br.close();
        fr.close();
        return sb.toString();
    }
}

Related

  1. readLine(String s)
  2. readLine(String s)
  3. readLine(String value, BufferedReader procout)
  4. readLineByLine(File file, char[][] terminators, boolean keepTerminators, Consumer readLineListener)
  5. readLineFile(File file)
  6. readLineFromCommand(String command[])
  7. readLineFromConsole()
  8. readLineHard(BufferedReader in)
  9. readLineList(String fileName)