Look closely at this little loop:
When you read in the while condition what happens to the line you read? See if this makes sense:
Back in mainframe days we used to call that a "primer read" plus the read in the loop. But nowadays we try to eliminate duplication and this is a more common syntax:
The first time you read this it probably makes no sense. The trick is that an assignment statement like "line = br.readLine()" also returns the value that was assigned, rather like a function. So we can stuff the value of the readLine() into the variable "line" and check it for null in one line of code.
There is another read() right before the loop. Does that one also throw away some data?
After all that, we probably don't need this read and write scheme at all. Look into the optional second argument on the FileWriter constructor.
