Here you can find the source of readLine(InputStream in)
public static String readLine(InputStream in)
//package com.java2s; //License from project: Apache License import java.io.BufferedReader; import java.io.IOException; import java.io.InputStream; import java.io.InputStreamReader; public class Main { public static String readLine(InputStream in) { final BufferedReader reader = new BufferedReader( new InputStreamReader(in)); final StringBuilder out = new StringBuilder(); final String newLine = System.getProperty("line.separator"); String line;// ww w. j a v a 2s .co m try { while ((line = reader.readLine()) != null) { out.append(line); out.append(newLine); } } catch (final IOException e) { throw new RuntimeException(e); } return out.toString(); } }