David> My fix is to assume that the size of the largest atomic output
David> sequence for *all* encodings is bounded and if the output
David> buffer is larger than this bound, then there is a problem with
David> the input and we should quit trying rather than expanding the
David> size of the output buffer.
There is code in InputStreamReader that handles this case in a
different way. I think both pieces of code should work the same way;
so could you look at that one and see (1) if it is susceptible to this
or some related problem (i.e., does it ensure that we make progress?)
David> A bonus fix is to catch java.io.CharConversionException and
David> stop the conversion. This keeps this checked exception from
David> escaping from the constructor which does not declare that that
David> it throws said exception.
It seems bad to throw this at all. IMO we should either declare it
properly, and fix the fallout in the Java code, or not throw it at
all.
For the String constructor one question is what the JDK does here.
I vaguely remember some funny business, but no details.