RFC: Character set converters...
Bryce McKinlay
mckinlay@redhat.com
Fri Aug 13 19:57:00 GMT 2004
David Daney wrote:
>>Since then, Bryce has said that he thinks the nio API is too
>>heavyweight. So, things are a bit undecided.
>>>Other that that I see no reason why gnu.java.nio.charset.* could not be
>made as efficient as gnu.gcj.convert.*
>>
How would you get data into the converter without either an extra layer
of copying, or creating a new CharBuffer instance each time (via the
wrap() method)? Seems to me you'd have to do one of these things for
every write() call.
That additional overhead might be acceptable if either using the
converters was simplified significantly, or it meant that a wider range
of high quality converters became available to us, but I don't think
either of those are the case. Implementing a new charset in the
java.nio.charset API is, I think, be significantly more complicated than
it would in the simpler gcj/classpath APIs.
This is just an argument against converting things like PrintStream to
use java.nio.charset directly. I certainly don't see a problem with
creating a gnu.gcj.convert wrapper for java.nio.charset in order to
handle additional encodings that we don't currently have in the
gnu.gcj.convert form.
Regards
Bryce
More information about the Java
mailing list