谁能解释解释这段代码是什么意思?
int total =bin.available(); //文件的总大小
int percent = total/100; //文件总量的百分之一
int count;
while((count = bin.available())!= 0){
int c = bin.read(); //从输入流中读一个字节
bout.write((char)c); //将字节(字符)写到输出流中 if(((total-count) % percent) == 0){
double d = (double)(total-count) / total; //必须强制转换成double
System.out.println(Math.round(d*100)+"%"); //输出百分比进度
}
}
|