Here you can find the source of readLines(ByteArrayInputStream outputSource)
private static String[] readLines(ByteArrayInputStream outputSource)
//package com.java2s; //License from project: Apache License import java.io.ByteArrayInputStream; import java.io.IOException; import java.io.InputStreamReader; import java.io.LineNumberReader; import java.util.ArrayList; public class Main { private static String[] readLines(ByteArrayInputStream outputSource) { try {/*from w ww. ja va 2s.c om*/ ArrayList<String> retval = new ArrayList<>(); final LineNumberReader reader = new LineNumberReader(new InputStreamReader(outputSource)); String line = null; while ((line = reader.readLine()) != null) { retval.add(line); } return retval.toArray(new String[retval.size()]); } catch (IOException e) { throw new RuntimeException(e); } } }