Simplify conversion of ByteArrayOutputStream to String
Closes gh-24785
This commit is contained in:
committed by
Sam Brannen
parent
62c545d0ed
commit
65aa2d03f0
@@ -90,7 +90,7 @@ class SortedProperties extends Properties {
|
||||
public void store(OutputStream out, @Nullable String comments) throws IOException {
|
||||
ByteArrayOutputStream baos = new ByteArrayOutputStream();
|
||||
super.store(baos, (this.omitComments ? null : comments));
|
||||
String contents = new String(baos.toByteArray(), StandardCharsets.ISO_8859_1);
|
||||
String contents = baos.toString(StandardCharsets.ISO_8859_1.name());
|
||||
for (String line : contents.split(EOL)) {
|
||||
if (!(this.omitComments && line.startsWith("#"))) {
|
||||
out.write((line + EOL).getBytes(StandardCharsets.ISO_8859_1));
|
||||
|
||||
Reference in New Issue
Block a user