RFR: 8372353: API to compute the byte length of a String encoded in a given Charset [v5]

Volkan Yazici vyazici at openjdk.org
Thu Jan 15 16:33:33 UTC 2026


On Thu, 15 Jan 2026 16:22:05 GMT, Liam Miller-Cushon <cushon at openjdk.org> wrote:

>> src/java.base/share/classes/java/lang/String.java line 2135:
>> 
>>> 2133:      * {@return the length in bytes of the given String encoded with the given {@link Charset}}
>>> 2134:      *
>>> 2135:      * <p>The result will be the same value as {@code getBytes(charset).length}.
>> 
>> Please @linkplain to the getBytes(cs) method.
>
> Done, thanks

The result will be the same value as {@link #getBytes(Charset) getBytes(cs).length}.

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

PR Review Comment: https://git.openjdk.org/jdk/pull/28454#discussion_r2695118671


More information about the core-libs-dev mailing list