When writing some documents with REXML to a file, the output ends at around 16k, even if it's in the middle of a tag. This is not true for all documents, but for some. I guess it's an IO error (it works with StringIO), but I couldn't find anything that sounded quite like it in recent bug reports, so I hope this is not a hidden duplicate.
Steps to reproduce:
Unzip test.xml from: http://www.raschke.de/julian/xml_before_after.zip
Run: jruby -rrexml/document -e "REXML::Document.new(File.new('test.xml')).write File.new('test2.xml', 'w')"
Compare test.xml and test2.xml.