Integrated: 8273528: Avoid ByteArrayOutputStream.toByteArray when converting stream to String

Andrey Turbanov github.com+741251+turbanoff at openjdk.java.net
Thu Sep 9 21:51:08 UTC 2021


On Thu, 2 Sep 2021 20:19:40 GMT, Andrey Turbanov <github.com+741251+turbanoff at openjdk.org> wrote:

> Using `ByteArrayOutputStream.toString` to convert it's content to a String is cleaner than `new String(out.toByteArray())`. Also it's a bit faster because of one less array copy.

This pull request has now been integrated.

Changeset: 2e321dc7
Author:    Andrey Turbanov <turbanoff at gmail.com>
Committer: Sergey Bylokhov <serb at openjdk.org>
URL:       https://git.openjdk.java.net/jdk/commit/2e321dc782e0de9995b1772e4cee9c0304bc183d
Stats:     6 lines in 4 files changed: 0 ins; 1 del; 5 mod

8273528: Avoid ByteArrayOutputStream.toByteArray when converting stream to String

Reviewed-by: bpb, xuelei, serb, aivanov

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

PR: https://git.openjdk.java.net/jdk/pull/5355



More information about the security-dev mailing list