What is the sense of buffer size in the constructor?
BufferedReader(Reader in, int size)
As i have written the program:
imp
When you read or write in a file, you must access the kernel, which actually gains access to the file. All file operations must go through the kernel. This is a fairly costly operation. Buffering causes a chunk of bytes to be read; these are held in a temporary location in RAM and are bytes are read in from this location. In this way, you are not making frequent requests of the kernel to do file IO.
If you use a huge buffer size, you will hog up RAM needlessly. If you use a tiny one, you will be bugging the kernel constantly for file requests. It is best to allow the default to be used. You can specify buffer size and experiment. Most machines will read a sector at a time or an integer number of sectors. The sector size depends upon how you format your machine.
The following experiment is interesting. Make a file with 1,000,000 zeroes in it. Use your OS's timing feature to see how fast it copies it to another file (you will write a copy program with buffered and unbuffered IO). Time it with various buffer sizes including the default.