Reduce garbage

This commit is contained in:
M66B 2019-08-09 20:16:36 +02:00
parent 55c990f9f3
commit 671e579163
1 changed files with 1 additions and 1 deletions

View File

@ -538,7 +538,7 @@ public class Helper {
}
static String readStream(InputStream is, String charset) throws IOException {
ByteArrayOutputStream os = new ByteArrayOutputStream();
ByteArrayOutputStream os = new ByteArrayOutputStream(Math.max(BUFFER_SIZE, is.available()));
byte[] buffer = new byte[BUFFER_SIZE];
for (int len = is.read(buffer); len != -1; len = is.read(buffer))
os.write(buffer, 0, len);