when you are using a buffered writer what happens is the data that you are reading from the file gets buffered. The data will be written to the file in two ways. One is by explicitly using the flush which is like pushing the data to the file after getting buffered. the other way is when the buffer gets full it automatically gets flushed. but it is always better to flush the data. in one line you collect the data and push the data with flush. hope this helps. shekar.
You should get in the habit of calling close() on a Reader/Writer/InputStream/OutputStream when you're done with it. Preferably in a finally{} clause to ensure it happens even if an exception is thrown. This will also call flush() as part of the close() operation, so you don't really need to call flush() separately.
Incidentally, readLine() will return a String that does not include any line terminators (\n or \r). So when you write the record to a new file, you probably want to add new line terminators too. This is typically achieved by using a PrintWriter, which has a println() method which uses your platform's default line terminator.
"I'm not back." - Bill Harding, Twister
I think he's gonna try to grab my monkey. Do we have a monkey outfit for this tiny ad?