`

URL 读取

 
阅读更多
	@Test(timeout=1000)
	public void fun1() throws Exception {
		String urlStr="http........";
		URL url=new URL(urlStr);
		BufferedReader in = new BufferedReader(new InputStreamReader(url.openStream()));
		String str;
        while((str = in.readLine()) != null)
                System.out.println(str);
        in.close();
	}

 

分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics