ITeye博客

android下载问题。本地与网络资源大小不一致解决方法

flyering · 2012-07-04 09:02 · android学习 · 移动开发 · Markdown

之前的代码:如下 output = new FileOutputStream(file); byte buffer = new byte; while ((input.read(buffer)) != -1) { output.write(buffer); } 修改好的代码:

output = new FileOutputStream(file); byte buffer = new byte; int length=0; while ((length = input.read(buffer)) != -1) { output.write(buffer, 0, length); }

评论(0)

暂无评论。

评论功能维护中,当前仅展示历史评论。