FileWriter problem (fast help required)

I have this problem parsinf RTF file and trying to convert it into XML file.

I have written my own RTF parser that reads the RTF file and writes to XML file. I have run the program on three different computers and on everyone of them I have the same problem. The output file has the size of 417792 bytes. The condition to close the XML file is that the RTF file has been read but the XML file is not complete. By that I mean that when it reaches the size of 417792 bytes any Strung that I try to write using the write method of FileWriter class isn't written properly.

Example:

witer.write("<newline/>");

in file:

<newl

Does anyone know why does it happen?

And is there a possibility of changing the buffer size?>

[775 byte] By [Boczek83a] at [2007-10-2 20:35:40]
# 1
Do you flush and close the FileWriter when you are finished writing?
Mr_Meea at 2007-7-13 23:18:53 > top of Java-index,Java Essentials,Java Programming...
# 2
Yes I do. If i didn't the output file wouldn't have any size.
Boczek83a at 2007-7-13 23:18:53 > top of Java-index,Java Essentials,Java Programming...
# 3

Can you reproduce the same behaviour with a simpler program and post it here?

The number that you quote, 417792 B, is a multiple of 4 kiB, the default buffer size. This would be the behaviour you would be seeing if the file is not getting closed properly. Are you absolutely sure you are closing the file, even in exceptional situations? You are calling writer.close() in a finally {} -block, right?

Mr_Meea at 2007-7-13 23:18:53 > top of Java-index,Java Essentials,Java Programming...
# 4
I managed to overcome the problem:). Thx for help:).
Boczek83a at 2007-7-13 23:18:53 > top of Java-index,Java Essentials,Java Programming...