下載
来源:互联网 发布:java视频上传 编辑:程序博客网 时间:2024/05/16 21:31
import java.io.FileOutputStream;
import java.io.InputStream;
import java.io.OutputStream;
import java.net.URL;
import java.net.URLConnection;
public class URLConnectionDownloader {
public static void main(String[] args) throws Exception {
download("http://www.laozizhu.com/images/logo.gif", "laozizhu.com.gif");
}
public static void download(String urlString, String filename) throws Exception {
URL url = new URL(urlString);
URLConnection con = url.openConnection();
InputStream is = con.getInputStream();
byte[] bs = new byte[1024];
int len;
OutputStream os = new FileOutputStream(filename);
while ((len = is.read(bs)) != -1) {
os.write(bs, 0, len);
}
os.close();
is.close();
}
}
- 下載
- vs2005中文下載
- NewWebPick 11下載
- VS2008下載
- .net 教程下載
- 下載netlistener
- Smartform下載PDF
- ajax 文件下載
- 【原创】【電腦排障電子書】提供下載...
- struts2 文件下載 問題
- spring mvc 模板下載
- GO語言視頻教程下載
- Response下載文件亂碼問題處理
- rpm 文件下載地址
- 一個Sniffer教程下載地址
- asp.net下載往上圖片
- nod32/ESET下載及更新
- JSP 2.0 技術手冊 試讀章節 下載
- 备份OA数据
- Oracle数据库的闪回恢复区及多归档路径的设置
- 注册了 很开心
- 让 eclipse, 忽略掉了错误提示
- 将数据库中内容导入/导出为excel
- 下載
- pku 1159 Palindrome
- 心理美容,女性最好的化妆品
- PLD,CPLD,FPGA区别
- ASP 五大内置对象
- There was a failure while initializing the Microsoft Visual SourceSafe
- 定時執行(Timer/TimerTask)
- Remoting系列(一)----Remoting的基本概念
- oracle例程恢复