I write a small code, say
ByteBuffer buffer = ByteBuffer.allocate(10);
int w= fc.read(buffer);
System.out.println(w);
w= fc.read(buffer);
System.out.println(w);
w= fc.read(buffer);
System.out.println(w);
say the file contains 10 bytes, the result appeared on the screen is 10, 0, 0, but no -1 appers as the end of the file, why?