我要做的是在下载升级包过程中要一直检测内存。
while(((ch = Is.read(buf)) != -1)&&hasEnoughMemory()) {
                                                        fileOutputStream.write(buf, 0, ch);//下载文件函数
Boolean hasEnoughMemory()为检测内存函数,Is.read(buf))为读取下载的流文件。我这样写可以吗