Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Hoe to use the readLine() method when reading from a URL? 1

Status
Not open for further replies.

thelordoftherings

Programmer
May 16, 2004
616
IL
Hello,

I have a URL which contains text input.
The only way to get the data from this URL is by opening a URL connection to it.
I would like to get the data from this URL but at the same time I would like to be able to use readLine() method of BufferedReader in order to read the data line by line.
My question is how do I combine between these two requirements in order to reed the data from the URL?
 
Open a HttpURLConnection object.

Then do :

BufferedReader br = new BufferedReader(new InputStreamReader(htttpConnection.getInputStream()));

--------------------------------------------------
Free Database Connection Pooling Software
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top