Skip to content

Commit

Permalink
Construct StringBuilder in StreamUtils with appropriate initial size
Browse files Browse the repository at this point in the history
Closes gh-25789
  • Loading branch information
jhoeller committed Oct 7, 2020
1 parent eb11c6f commit ec9de94
Showing 1 changed file with 1 addition and 1 deletion.
Expand Up @@ -84,7 +84,7 @@ public static String copyToString(@Nullable InputStream in, Charset charset) thr
return "";
}

StringBuilder out = new StringBuilder();
StringBuilder out = new StringBuilder(BUFFER_SIZE);
InputStreamReader reader = new InputStreamReader(in, charset);
char[] buffer = new char[BUFFER_SIZE];
int charsRead;
Expand Down

0 comments on commit ec9de94

Please sign in to comment.