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
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: 8710
    
    6

Please don't crosspost.


"blabbing like a narcissistic fool with a superiority complex" ~ N.A.
[How To Ask Questions On JavaRanch]
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: How to get a String from an InputStream
 
Similar Threads
multiple http connections in series
Can anybody tell me why this code is not working?
HTTP Error Codes Help
Read XML output from a URL
difference between openConnection() and connect() methods