Here you can find the source of readLine(InputStreamReader reader)
public static String readLine(InputStreamReader reader) throws IOException
//package com.java2s; //License from project: Open Source License import java.io.IOException; import java.io.InputStreamReader; public class Main { /** Reads a line from a reader. */ public static String readLine(InputStreamReader reader) throws IOException { int c = reader.read(); if (c == -1) { return null; }// www . ja va 2 s .co m StringBuffer line = new StringBuffer(); while (c != -1 && c != '\n') { if (c != '\r') { line.append((char) c); } c = reader.read(); } return line.toString(); } }