I'm trying to read from an input stream of a HttpURLConnection:
InputStream input = conn.getInputStream();
InputStreamReader isr = new InputStreamReader((input));
BufferedReader br = new BufferedReader(isr);
StringBuilder out = new StringBuilder("");
String output;
while ((output = br.readLine()) != null) {
out.append(output);
}
This does take too much time when the input stream contains a lot of data. Is it possible to optimize this?