URL Reader : URL : Network Protocol : Java examples (example source code) Organized by topic

Java
C++
PHP
Java Home »  Network Protocol   » [  URL  ]  Screenshots 
 



URL Reader

/* From http://java.sun.com/docs/books/tutorial/index.html */


import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.net.URL;

public class URLReader {
  public static void main(String[] argsthrows Exception {
    URL yahoo = new URL("http://www.yahoo.com/");
    BufferedReader in = new BufferedReader(new InputStreamReader(yahoo
        .openStream()));

    String inputLine;

    while ((inputLine = in.readLine()) != null)
      System.out.println(inputLine);

    in.close();
  }
}
           
       
Related examples in the same category
1.  URL Constructor Test
2.  URL Encode Test
3.  Get URL Content
4.  Get URL Parts
5.  Read from a URL
6.  URL Equality
7.  URL Request
8.  URL Get
9.  URL Connection Reader URL Connection Reader
10.  URLConnection
11.  Parse URL Parse URL
























Home| Contact Us
Copyright 2003 - 04 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.