I'm not an expert on Java streams so I'm not going to try to figure out what's wrong with your code. I will, however, give you a piece of code that's working for me.
I will mention two things that I noticed about your code. 1.) you're flushing the buffer before you've started reading into it. I don't know if this is causing a problem but it's certainly not necessary.
2.) Your variable names (combined with the lack of UBB code tags) make it very difficult for someone else to read your code. You're reading and writing chars as ints but naming them "line" (it's possible to read from a text file one line at a time and at first glance, I thought that's what you were doing.) You've also named a FileInputStream "bufReader" which makes it look, at first glance, like you're using an instance of java.io.BufferedReader.
I normally don't pick nits but in this case, I think these issues are going to keep you from getting help with your code. [ May 07, 2005: Message edited by: Ben Souther ]