This is the mail archive of the
java@gcc.gnu.org
mailing list for the Java project.
Re: RFC: Character set converters...
Bryce McKinlay wrote:
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.
Can you not allocate the CharBuffer/ByteBuffers in the
OutputStreamWriter and InputStreamReader classes?
We could define gnu.java.io.BufferedOutputStream and
gnu.java.io.BufferedInputStream classes, which would be
functionally equivalent to java.io.BufferedOutputStream
and java.io.BufferedInputStream, except that they use
direct byte buffers. Hence they don't export the old
protected fields, but instead export a ByteBuffer.
Internal code would use these new classes. This
includes OutputStreamWriter and InputStreamReader.
The OutputStreamWriter/InputStreamWriter would
allocate a CharBuffer.
--
--Per Bothner
per@bothner.com http://per.bothner.com/