Here you can find the source of readAllLines(InputStream is)
public static List<String> readAllLines(InputStream is) throws IOException
//package com.java2s; //License from project: Open Source 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> readAllLines(InputStream is) throws IOException { List<String> ls = new ArrayList<String>(); BufferedReader buffer = new BufferedReader(new InputStreamReader(is)); String line;// w w w .j a va2 s . c o m while ((line = buffer.readLine()) != null) { ls.add(line); } return ls; } }