【发布时间】:2020-08-15 10:04:02
【问题描述】:
我有这样的代码
public void downloadZip(String URL, String fileName) {
try {
java.net.URL url = new URL(URL);
URLConnection conn = url.openConnection();
InputStream in = conn.getInputStream();
FileOutputStream out = new FileOutputStream(save + "/" + fileName);
byte[] b = new byte[4096];
int count;
while ((count = in.read(b)) >= 0) {
out.write(b, 0, count);
}
out.flush(); out.close(); in.close();
} catch (IOException e) {
e.printStackTrace();
}
}
如何重写它才能继续/停止加载?
【问题讨论】:
-
您会发现,当您尽可能具体地解释您的问题时,StackOverflow 对您的帮助最大。这个问题看起来像你要求我们为你做你的工作。请自己尝试一些解决方案,并告诉我们您已经尝试过什么,为什么它不起作用等。祝您好运。
标签: java https download zip desktop