aspose file tools*
The moose likes I/O and Streams and the fly likes How to get a String from an InputStream Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Java » I/O and Streams
Bookmark "How to get a String from an InputStream" Watch "How to get a String from an InputStream" New topic
Author

How to get a String from an InputStream

Steve Watson
Ranch Hand

Joined: Apr 08, 2003
Posts: 38
I am getting an InputStream from an HttpURLConnection as follows"

URL url = new URL("http://www.amazon.com");
HttpURLConnection connection = new HttpURLConnection(url);
InputStream inputStream = connection.getInputStream();

I want to extract a String of the HTML from this connection. How do I get it from the InputStream?
Joe Ess
Bartender

Joined: Oct 29, 2001
Posts: 8927
    
    9

Please don't crosspost.


"blabbing like a narcissistic fool with a superiority complex" ~ N.A.
[How To Ask Questions On JavaRanch]
 
 
subject: How to get a String from an InputStream