我有这个酸:
public static void inBufferBooks() throws IOException
{
Reader inStreamBooks = null;
BufferedReader bufferIn = null;
try
{
inStreamBooks = new FileReader("Files/BufferBook.txt");
bufferIn = new BufferedReader(inStreamBooks);
char text[] = new char[10];
int i = -1;
while ((i = inStreamBooks.read(text, 0, 10)) != -1)
{
System.out.print(text);
}
当我在文本控制台的末尾读取文件时,打印填充最后一个数组的字符。如何从文件中读取整个文本而没有最后一个数组的冗余字符?