I am using a BufferedReader
constructor to make a new copy of an existing BufferedReader
.
BufferedReader buffReader = new BufferedR
Passing in a BufferedReader
instance in the constructor for a new BufferedReader
will not make a copy of the original BufferedReader!
What you are doing there is chaining the two reader, in other words, you are buffering the already buffered reader instance. When you call readLine()
on buffReader
, it will call readLine()
on originalBuffReader
.
Take a look here for more details of the chaining of streams: Chaining of Streams