弱智的问题?但是我真的不懂,请帮我解释
public int readLine(byte[] b, int off, int len) throws IOException {
if (len <= 0) {
return 0;
}
int count = 0, c;
while ((c = read()) != -1) {
b[off++] = (byte)c;
count++;
if (c == '\n' || count == len) {
break;
}
}
return count > 0 ? count : -1;
}
}
我就是弄不懂while ((c = read()) != -1)这句是怎么运做的,怎么解释的?