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
|
|
14 import java.net.*;
|
|
15 import java.io.*;
|
|
16 // mport java.nio.*;
|
|
17
|
|
18
|
|
19 /**
|
|
20 * URLKicker
|
|
21 *
|
|
22 * @author Shinji Kono
|
|
23 *
|
|
24 * @param args[] The URL to connect to
|
|
25
|
|
26 */
|
|
27
|
|
28 class URLKicker {
|
|
29 public static char buf[];
|
|
30
|
|
31 public static void main (String args[]) {
|
|
32 InputStreamReader is;
|
|
33 buf = new char[1024];
|
|
34 try {
|
|
35 URL a = new URL(args[0]);
|
|
36 URLConnection conn = a.openConnection();
|
|
37 is = new InputStreamReader(conn.getInputStream());
|
|
38 int ret = 0;
|
|
39 while ((ret = is.read(buf,0,1024)) > 0) {
|
|
40 processBuf(buf,ret);
|
|
41 }
|
|
42 // close the inputstream
|
|
43 is.close();
|
|
44 } catch (IOException e) {
|
|
45 }
|
|
46 }
|
|
47 public static void processBuf (char buf[],int len) {
|
|
48 // System.out.print("data: ");
|
|
49 // for(int i=0;i<len;i++) {
|
|
50 // System.out.print(buf[i]);
|
|
51 // }
|
|
52 }
|
|
53
|
|
54 }
|
|
55
|
|
56
|