java.io.CharConversionException: Output buffer too small
at java.io.OutputStreamWriter.write(OutputStreamWriter.java)
at java.io.Writer.write(Writer.java)
at gen.main(gen.java:29)
See the enclosed "gen.java" file ... run it a few times (it generates
data randomly -- collect the seeds to find one that generates the error,
then reuse that if you like):
java gen filename.xml UTF8
Before very long you'll get an exception like the one reported above. This
is clearly a bug in the implementation, since it has no business failing to
allocate sufficient space for a character in its internal buffer! (Also,
note that at some point I started getting error reports with the surrogate
generation code, and don't know what changed to make them happen. The bug
shows up either way, although more often when surrogates are used I think.)
You'll note that java.io.OutputStreamWriter only reports this when it gets
a ConversionBufferFull exception. I think that it may be interpreting
the exception incorrectly ... the fact that it's full doesn't mean that
no characters were written.