Here you can find the source of readLines(Reader reader)
public static String readLines(Reader reader) throws IOException
//package com.java2s; //License from project: Apache License import java.io.BufferedReader; import java.io.IOException; import java.io.Reader; public class Main { public static String readLines(Reader reader) throws IOException { BufferedReader buf = new BufferedReader(reader); StringBuilder string = new StringBuilder(); String line = buf.readLine(); while (line != null) { string.append(line);//w ww. j ava 2 s . c om line = buf.readLine(); if (line != null) { string.append("\n"); } } return string.toString(); } }