标签:leo tput 链接 out string write while output read
String str = null;
int size;
byte[] bytes = new byte[1024];
File file = new File("缓存目录");
URL url = new URL("图片链接");
BufferedInputStream bis = new BufferedInputStream(url.openStream());
BufferedOutputStream bos = new BufferedOutputStream(new FileOutputStream(file));
while((size = bis.read(bytes)) != -1){
bos.write(bytes,0,size);
}
bos.close();
bis.close();
标签:leo tput 链接 out string write while output read
原文地址:https://www.cnblogs.com/Timor88/p/13198966.html