RFC: Character set converters...
Fri Aug 13 19:17:00 GMT 2004
Tom Tromey wrote:
>>>>>>"David" == David Daney <email@example.com> writes:
> David> This works, but I was thinking that perhaps a better way would
> David> be to add a general purpose adapter into
> David> gnu.gcj.convert.UnicodeToBytes so that it could use the
> David> java.nio.charset converters. Thus eliminating duplicated code.
> David> Does this make any sense?
> Since then, Bryce has said that he thinks the nio API is too
> heavyweight. So, things are a bit undecided.
The current gnu.java.nio.charset implementation is too heavy weight.
One problem it has is that all known Charsets are instantiated the first
time any Charset is requested.
It does this because it uses the names and aliases reported by the
Charset to populate an internal map. If we changed it so that the
mappings were hard coded or read out of some resource, then the overhead
would be much lower.
Other that that I see no reason why gnu.java.nio.charset.* could not be
made as efficient as gnu.gcj.convert.*
More information about the Java