List of utility methods to do BufferedReader to String
String | bufferToString(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(); ... |
String | loadText(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(); |