view src/fdl/URLKicker.java @ 7:1809e2b05824

Initial revision
author fuchita
date Sat, 16 Feb 2008 13:12:52 +0900
parents 083a0b5e12cc
children 35375016b2f0
line wrap: on
line source


/*
 * @(#)PSXLindaURLKicker.java       1.1 06/04/01
 *
 * Copyright 2006  Shinji KONO
 * 

   Kick some url

 */

package fdl;

import java.net.*;
import java.io.*;
// mport java.nio.*;


/**
 *   URLKicker
 *
 * @author Shinji Kono
 *
 * @param args[] The URL to connect to

 */

class URLKicker {
    public static char buf[];

    public static void main (String args[]) {
	InputStreamReader is;
	buf = new char[1024];
	try {
		URL a = new URL(args[0]);
		URLConnection conn = a.openConnection();
		is = new InputStreamReader(conn.getInputStream());
		int ret = 0;
		while ((ret = is.read(buf,0,1024)) > 0) {
		  processBuf(buf,ret);
		}
		// close the inputstream
		is.close();
	} catch (IOException e) {
	}
    }
    public static void processBuf (char buf[],int len) {
//	System.out.print("data: ");
//	for(int i=0;i<len;i++) {
//	    System.out.print(buf[i]);
//	}
    }

}