Here you can find the source of readLines(InputStream inputStream)
public static List<String> readLines(InputStream inputStream) throws IOException
//package com.java2s; //License from project: Apache License import java.io.BufferedReader; import java.io.IOException; import java.io.InputStream; import java.io.InputStreamReader; import java.util.ArrayList; import java.util.List; public class Main { public static List<String> readLines(InputStream inputStream) throws IOException { BufferedReader reader = new BufferedReader(new InputStreamReader(inputStream)); List<String> lines = new ArrayList<String>(); String line = reader.readLine(); while (line != null) { lines.add(line);/*from w ww.j a v a 2 s .c om*/ line = reader.readLine(); } reader.close(); return lines; } }