Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Cloud/Virtualization forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

How to get a String from an InputStream

 
Steve Watson
Ranch Hand
Posts: 38
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Pie
Posts: 9259
10
Linux Mac OS X Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Please don't crosspost.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic