当中的while问题
public static void main(String[] args) throws IOException{
FileInputStream files = new FileInputStream("C:\\Users\\26023\\Desktop\\html.txt");
int n = 0;
byte[] bytes = new byte[1024*3];
int j = 1;
//从files中读出数据存放到bytes
while((n=files.read(bytes, 0, bytes.length))!=-1){
for(int i = 0 ; i<n;i++) {
System.out.print(Integer.toHexString(bytes[i]&0xff)+" ");
if(j++ %10 == 0) {
System.out.println();
}
}
}
files.close();
}
为什么在while里的for中,要用n(课程里用的bytes)作为限制条件