1 |
More interesting is to access a URL and process the information there!
|
2 |
This is done using a stdio like stream (generalizes pipe) which is supported in java.io package with usual buffering capabilities
|
3 |
There are methods in class URL -- InputStream in = instanceofURL.openStream(); // opens an InputStream associated with given url
|
4 |
More general is instanceofURL.openConnection() establishes a general connection and returns an instance of class URLConnection
-
This provides most general HTTP connectivity and indeed has some advantages over sockets as these are subject to special security restrictions in Netscape's current implementation
|
5 |
Note that one can connect not just to HTML files but also to CGI scripts i.e. programs at server and so obtain flexible connectivity
|