Crouchez wrote:
> It doesn't matter what size is given to BufferedWriter it still sends
> buffers of 8192.
Can you post the source you wrote for testing this? With the
constructor Roedy was showing I would expect the number of
bytes being sent to the underlying stream is dependent on the
characters being written and the encoding to be used. With x
characters written and UTF-8 used as encoding the number of
bytes should vary between x (ASCII) and 3x (0x800 - 0xffff).
So with a buffer-size of 4096 the number of bytes in your example
could reach up to 12288.
I don't know how OutputStreamWriter works internally but if there
is a buffer as well this might be the reason, why you always
get the same number of bytes. But I'm not going to look into that
further until you posted your test-code.
> Does sun.nio.cs.StreamEncoder buffer? And where is it?
In rt.jar or charset.jar, but I would expect it in the first one.
Regards, Lothar
--
Lothar Kimmeringer E-Mail:
PGP-encrypted mails preferred (Key-ID: 0x8BC3CD81)
Always remember: The answer is forty-two, there can only be wrong
questions!