Java examples for File Path IO:BufferedReader
read from Reader
//package com.java2s; import java.io.BufferedReader; import java.io.IOException; import java.io.Reader; public class Main { /**//w ww. j a va 2 s .c o m * * @param reader * @return * @throws IOException */ public static String readStream(Reader reader) throws IOException { StringBuilder result = new StringBuilder(); BufferedReader in = new BufferedReader(reader); String line; while ((line = in.readLine()) != null) { result.append(line); result.append('\n'); } in.close(); return result.toString(); } }