慕勒3428872
FileReader类的read() 方法的返回值表示从流中读到的字节数,如果返回-1,则表示已经读到文件末尾,即读取完毕。 :)以下是Java源代码里的read函数原型:
/**
* Reads a single character.
*
* @return The character read, or -1 if the end of the stream has been
* reached
*
* @exception IOException If an I/O error occurs
*/
public int read() throws IOException {
return sd.read();
}
从返回值说明中可以很明白地看到-------return The character read
至于 sd对象 是属于sun.nio.cs.StreamDecoder这个类的。 :)