List of utility methods to do InputStream to Text Line
ArrayList | toLines(InputStream is) to Lines ArrayList<String> lines = new ArrayList<String>(); Scanner in = new Scanner(is); while (in.hasNextLine()) { String line = in.nextLine().trim(); if (line.length() > 0) lines.add(line); return lines; ... |
List | toLines(InputStream is) Returns a list of Strings that represent lines in the fiven InputStream is . final ArrayList<String> lines = new ArrayList<String>(); InputStreamReader reader = new InputStreamReader(is); BufferedReader br = new BufferedReader(reader); String line; while (null != (line = br.readLine())) { lines.add(line); return lines; ... |