question: public static void readLines ( InputStream stream , Consumer < String > lineProcessor ) throws IOException { try ( BufferedReader reader = new BufferedReader ( new InputStreamReader ( stream ) ) ) { String line = null ; while ( ( line = reader . readLine ( ) ) != null ) { lineProcessor . accept ( line ) ; } } }
target:  Read the lines from the supplied stream. This function completely reads the stream and therefore closes the stream.