1import java.net.URL;
2import java.io.Reader;
3import java.io.InputStreamReader;
4
5public class URLContent {
6
7 public static void main(String[] argv) {
8 try {
9 URL u =
10 new URL(argv[0]);
11
12 Reader s =
13 new InputStreamReader(u.openStream());
14
15 int c;
16
17 while ( (c = s.read()) != -1 ) {
18 System.out.print((char)c);
19 }
20
21 s.close();
22
23 }
24 catch (Exception e) {
25 System.out.println(e);
26 }
27 }
28}