This is the mail archive of the
java-patches@gcc.gnu.org
mailing list for the Java project.
Re: RFC: caching for I/O converters
minyard@acm.org writes:
> I don't understand how you would tell it which decoder to use. A
> static converter wouldn't work for that, but a method on each decoder
> that did a one-shot conversion would probably work. You would still
> have to allocate one of each decoder you used to do this, though.
Yes, that was my idea.
> And you would have to modify all the decoders to add the method.
Not necessarily - you could support the exiting framework in parallel.
> I still think the array would be best.
I agree, at least for now. I'm thinking that if my idea makes
sense, it might make even more sense to do it at the C++ level,
perhaps with an interface similar to (compatible with) iconv.
That has the big advantage that it can work on buffers that are
not Java arrays. For example you could implement a FileReader
or FileWriter without actually allocating a Java byte[]; instead it
could copy in/out of lower-level page-aligned buffers. But I think
such an idea will have to wait for some other time.
> I can do a new patch, if you like.
Please do.
--
--Per Bothner
per@bothner.com http://www.bothner.com/per/