标签:blog http io java ar for 2014 on c
package com.test.brouse; import java.io.IOException; import java.io.InputStream; import java.net.MalformedURLException; import java.net.URL; public class Html { /** * @param args * @throws IOException * @throws MalformedURLException */ public static void main(String[] args) throws MalformedURLException, IOException { // TODO Auto-generated method stub InputStream in=(new URL("http://www.baidu.com")).openStream(); int c=-1; while((c=in.read())!=-1) { System.out.write(c); } } }
输出结果为
标签:blog http io java ar for 2014 on c
原文地址:http://blog.csdn.net/itbuluoge/article/details/39478003