8273528: Avoid ByteArrayOutputStream.toByteArray when converting stream to String

Reviewed-by: bpb, xuelei, serb, aivanov
This commit is contained in:
Andrey Turbanov 2021-09-09 21:47:59 +00:00 committed by Sergey Bylokhov
parent 54dee132d1
commit 2e321dc782
4 changed files with 5 additions and 6 deletions

View file

@ -1,5 +1,5 @@
/*
* Copyright (c) 1997, 2019, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1997, 2021, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@ -261,7 +261,7 @@ public class BitArray {
out.write(get(i) ? '1' : '0');
}
return new String(out.toByteArray());
return out.toString();
}