标签:input puts com style pac tput java.net nbsp java
package zuihou; import java.io.BufferedReader; import java.io.FileOutputStream; import java.io.IOException; import java.io.InputStream; import java.io.InputStreamReader; import java.net.MalformedURLException; import java.net.URL; import java.net.URLConnection; public class DownLoad { public static void main(String[] args) throws IOException { URL url=new URL("http://588ku.com/banner/4694318.html"); URLConnection conn=url.openConnection(); InputStream is=conn.getInputStream(); BufferedReader br=new BufferedReader(new InputStreamReader(is)); //FileOutputStream fos=new FileOutputStream("d:/abc.html"); //byte[]b=new byte[100]; //int i=-1; //while((i=is.read(b))!=-1){ // fos.write(b,0,i); //} //fos.close(); String str=null; while((str=br.readLine())!=null){ System.out.println(str); } is.close(); } }
标签:input puts com style pac tput java.net nbsp java
原文地址:http://www.cnblogs.com/zyy1130/p/6852473.html