Java tutorial
//package com.java2s; //License from project: Apache License import java.io.BufferedReader; import java.io.IOException; import java.io.Reader; public class Main { static String readerToString(Reader reader) throws IOException { StringBuffer stringBuffer = new StringBuffer(); BufferedReader bufferedReaderA = new BufferedReader(reader); String readingString = bufferedReaderA.readLine(); while (readingString != null) { stringBuffer.append(readingString); readingString = bufferedReaderA.readLine(); } return stringBuffer.toString(); } }