Here you can find the source of asArrayString(InputStream response)
public static String[] asArrayString(InputStream response)
//package com.java2s; //License from project: Apache License import java.io.*; import java.util.ArrayList; import java.util.List; public class Main { public static String[] asArrayString(InputStream response) { List<String> lines = new ArrayList<>(); try (BufferedReader bufferedReader = new BufferedReader(new InputStreamReader(response))) { String line = null;/*from www . jav a2s.c o m*/ while ((line = bufferedReader.readLine()) != null) { lines.add(line); } return lines.toArray(new String[lines.size()]); } catch (IOException e) { throw new RuntimeException(e); } } }