我要做的是在下载升级包过程中要一直检测内存。
while(((ch = Is.read(buf)) != -1)&&hasEnoughMemory()) {
fileOutputStream.write(buf, 0, ch);//下载文件函数
Boolean hasEnoughMemory()为检测内存函数,Is.read(buf))为读取下载的流文件。我这样写可以吗
while(((ch = Is.read(buf)) != -1)&&hasEnoughMemory()) {
fileOutputStream.write(buf, 0, ch);//下载文件函数
Boolean hasEnoughMemory()为检测内存函数,Is.read(buf))为读取下载的流文件。我这样写可以吗
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货