Win a copy of Getting started with Java programming language this week in the Beginning Java forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

How to get a String from an InputStream  RSS feed

 
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
Posts: 9400
12
Linux Mac OS X Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Please don't crosspost.
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!