On Mon, 19 Jan 2026 08:14:11 GMT, Liam Miller-Cushon <[email protected]> wrote:

> The motivating use cases I've seen for this method are to compute the length 
> of encoded data that contains strings, where the strings would be encoded 
> with `getBytes`. The CSR gives the example of encoding multiple large strings 
> into a single array. Specifying the output in terms of `getBytes(cs).length` 
> is necessary for that use-case, and requires the handling of replacement 
> characters and unpaired surrogates to be the same between the two methods. Do 
> you see alternatives that should be considered?

The comment wasn't questing the addition. Instead we are saying that there is 
no mention of coding-error actions. More specifically, I think we should insert 
a sentence before "The result will be the same ..." to say that the returned 
length takes account of the replacement of malformed-input and 
unmappable-character sequences with the charset's default replacement byte 
array.

-------------

PR Comment: https://git.openjdk.org/jdk/pull/28454#issuecomment-3769823410

Reply via email to