/** * Copyright (c): Uwe Schmidt, FH Wedel * * You may study, modify and distribute this source code * FOR NON-COMMERCIAL PURPOSES ONLY. * This copyright message has to remain unchanged. * * Note that this document is provided 'as is', * WITHOUT WARRANTY of any kind either expressed or implied. */ import java.net.URL; import java.io.Reader; import java.io.InputStreamReader; public class URLContent { public static void main(String[] argv) { try { URL u = new URL(argv[0]); Reader s = new InputStreamReader(u.openStream()); int c; while ( (c = s.read()) != -1 ) { System.out.print((char)c); } s.close(); } catch (Exception e) { System.out.println(e); } } }