A buffered input stream fills a buffer with data that hasn’t been handled yet. When a program
needs this data, it looks to the buffer first before going to the original stream
source.Buffered byte streams use the BufferedInputStream and BufferedOutputStream classes.
Buffered Reader Class (java.io.*)
A buffer stores keys from the InputStreamReader it in an allocated memory area called a buffer.
Your program will read characters from the buffer rather than directly from the device. This relieves
the input device from being accessed every time data is required from the program.
Are these Buffer same? Is this the same buffer that if fills too much make "Buffer Overflow"?
A "buffer" is a general concept; it's not one specific memory location, or anything like that. BufferedReader, BufferedInputStream, etc, each have an array inside which acts as the buffer for that object. Your operating system will maintain its own buffers for various purposes.
"Buffer overflow" means that there is more data to be stored than will fit in the fixed-sized buffer being used in some particular situation. It could arise in many different contexts.
You realise there is a potential error in your reading? You are not closing the Reader when you have finished with it. You should close Readers and Writers in finally blocks, so as to ensure they are closed whether an Exception occurs or not.