是的。BufferedReader in
= new BufferedReader(new FileReader("foo.in"));
will buffer the input from the specified file.Without buffering, each invocation of read() or readLine() could cause bytes to be read from the file, converted into characters, and then returned, which can be very inefficient. 翻译一下就是:
BufferedReader in
= new BufferedReader(new FileReader("foo.in"));
会把来自指定文件的输入缓存起来。如果不采用缓存,那么每一次对read或者readLine的调用都会引起从文件中读取字节,转传成字符,然后返回,这是很低效的。
= new BufferedReader(new FileReader("foo.in"));
will buffer the input from the specified file.Without buffering, each invocation of read() or readLine() could cause bytes to be read from the file, converted into characters, and then returned, which can be very inefficient. 翻译一下就是:
BufferedReader in
= new BufferedReader(new FileReader("foo.in"));
会把来自指定文件的输入缓存起来。如果不采用缓存,那么每一次对read或者readLine的调用都会引起从文件中读取字节,转传成字符,然后返回,这是很低效的。
1.缓存是在内存上开空间缓存呢,还是在硬盘上开空间缓存?
2.缓存起什么作用啊?什么原理啊?……………………
3.…………反正就是不明白~~~~