This is the mail archive of the
java@gcc.gnu.org
mailing list for the Java project.
Re: RFC: Character set converters...
- From: David Daney <ddaney at avtrex dot com>
- To: tromey at redhat dot com
- Cc: java at gcc dot gnu dot org, Bryce McKinlay <mckinlay at redhat dot com>
- Date: Fri, 13 Aug 2004 11:41:39 -0700
- Subject: Re: RFC: Character set converters...
- References: <411BDF34.7070500@avtrex.com> <87hdr7nixo.fsf@fleche.redhat.com>
Tom Tromey wrote:
>>>>>>"David" == David Daney <ddaney@avtrex.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.*
David Daney.