Here you can find the source of getConnectionStream(HttpURLConnection con)
Parameter | Description |
---|---|
con | The connection to the HTTP address |
public static BufferedReader getConnectionStream(HttpURLConnection con) throws IOException
//package com.java2s; //License from project: Apache License import java.io.BufferedReader; import java.io.IOException; import java.io.InputStream; import java.io.InputStreamReader; import java.net.HttpURLConnection; public class Main { /**// w w w . j av a 2s .c o m * This method is used to get a connection stream from an HTTP connection. It * gives the output from the webpage that it gets from the connection * * @param con The connection to the HTTP address * @return The Output from the webpage */ public static BufferedReader getConnectionStream(HttpURLConnection con) throws IOException { InputStream is = con.getInputStream(); InputStreamReader isr = new InputStreamReader(is); BufferedReader br = new BufferedReader(isr); return br; } }