Java BufferedReader Read load(String filename)

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

Description

load

License

Open Source License

Declaration

public static final String load(String filename) 

Method Source Code

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

import java.io.BufferedReader;

import java.io.FileReader;

import java.io.IOException;

public class Main {
    public static final String load(String filename) {
        StringBuilder sb = new StringBuilder();
        String line;//from w w w  .j  a va 2 s  .  c o  m

        try (BufferedReader br = new BufferedReader(
                new FileReader(filename))) {
            while ((line = br.readLine()) != null) {
                sb.append(line);
                sb.append(System.lineSeparator());
            }
        } catch (IOException e) {
            return null;
        }

        return sb.toString();
    }
}

Related

  1. load(File file)
  2. load(File pFile)
  3. load(final Multimap map, final Reader source)
  4. load(final String path, final String file)
  5. loadAddressList(String filename)
  6. loadAFileToString2(File f)
  7. loadAPIKey(InputStream in)
  8. loadAuthFile(String fileName)