Java Utililty Methods BufferedReader to String

List of utility methods to do BufferedReader to String

Description

The list of methods to do BufferedReader to String are organized into topic(s).

Method

StringbufferToString(BufferedReader br)
buffer To String
StringBuffer sb = new StringBuffer();
try {
    for (String s = null; (s = br.readLine()) != null;)
        sb.append(s + "\n");
} catch (Exception e) {
    throw new Exception("Error reading the buffer: " + e.getMessage());
return sb.toString();
...
StringloadText(BufferedReader reader)
Loads the given BufferedReader as text, line by line into a String .
StringBuilder result = new StringBuilder();
String line;
while ((line = reader.readLine()) != null) {
    result.append(line).append('\n');
return result.toString();