Here you can find the source of readAllLines(InputStream inputStream)
private static List<String> readAllLines(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 { private static List<String> readAllLines(InputStream inputStream) throws IOException { BufferedReader br = new BufferedReader(new InputStreamReader(inputStream)); List<String> data = new ArrayList<>(); for (String line; (line = br.readLine()) != null;) { data.add(line);/* ww w . ja va 2s .c om*/ } return data; } }