0
|
1
|
|
2 /*
|
|
3 * @(#)PSXLindaURLKicker.java 1.1 06/04/01
|
|
4 *
|
|
5 * Copyright 2006 Shinji KONO
|
|
6 *
|
|
7
|
|
8 Kick some url
|
|
9
|
|
10 */
|
|
11
|
|
12 package fdl;
|
|
13
|
66
|
14 import java.io.IOException;
|
|
15 import java.io.InputStreamReader;
|
|
16 import java.net.URL;
|
|
17 import java.net.URLConnection;
|
0
|
18
|
|
19
|
|
20 /**
|
|
21 * URLKicker
|
|
22 *
|
|
23 * @author Shinji Kono
|
|
24 *
|
|
25 * @param args[] The URL to connect to
|
|
26
|
|
27 */
|
|
28
|
|
29 class URLKicker {
|
|
30 public static char buf[];
|
|
31
|
|
32 public static void main (String args[]) {
|
|
33 InputStreamReader is;
|
|
34 buf = new char[1024];
|
|
35 try {
|
|
36 URL a = new URL(args[0]);
|
|
37 URLConnection conn = a.openConnection();
|
|
38 is = new InputStreamReader(conn.getInputStream());
|
|
39 int ret = 0;
|
|
40 while ((ret = is.read(buf,0,1024)) > 0) {
|
|
41 processBuf(buf,ret);
|
|
42 }
|
|
43 // close the inputstream
|
|
44 is.close();
|
|
45 } catch (IOException e) {
|
|
46 }
|
|
47 }
|
|
48 public static void processBuf (char buf[],int len) {
|
|
49 // System.out.print("data: ");
|
|
50 // for(int i=0;i<len;i++) {
|
|
51 // System.out.print(buf[i]);
|
|
52 // }
|
|
53 }
|
|
54
|
|
55 }
|
|
56
|
|
57
|