Re: Eliminate unnecessary buffering and encoding conversion in BufferedWriter

2025-06-29 Thread Chen Liang
when using LATIN1 String, and > the performance will not be good. > > -- > 发件人:Brett Okken > 发送时间:2025年6月30日(周一) 11:39 > 收件人:"温绍锦(高铁)" > 抄 送:"core-libs-dev" > 主 题:Re: Eliminate unnecessary bu

Re: Eliminate unnecessary buffering and encoding conversion in BufferedWriter

2025-06-29 Thread Alan Bateman
On 29/06/2025 17:03, wenshao wrote: BufferedWriter -> OutputStreamWriter -> StreamEncoder In this call chain, BufferedWriter has a char[] buffer, and StreamEncoder has a ByteBuffer. There are two layers of cache here, or the BufferedWriter layer can be removed. LATIN1 (byte[]) -> UTF16 (ch

Re: Eliminate unnecessary buffering and encoding conversion in BufferedWriter

2025-06-29 Thread Brett Okken
Maybe another option would be to implement BufferedWriter with a StringBuilder rather than a char[]. This would remove the force to utf-16 On Sun, Jun 29, 2025 at 10:36 PM Brett Okken wrote: > Is StreamEncoder buffering content to only write to the underlying > OutputStream when some threshold i

Re: Eliminate unnecessary buffering and encoding conversion in BufferedWriter

2025-06-29 Thread Brett Okken
Is StreamEncoder buffering content to only write to the underlying OutputStream when some threshold is hit? While the layers of conversions are unfortunate, it seems there could be negative performance implications of having many extremely small writes (such as 1 character/byte) at a time to the un