Changed to java version 1.8

This commit is contained in:
2024-08-07 17:36:25 +02:00
parent 36a318183e
commit fad4ef83c1

View File

@@ -46,12 +46,14 @@ public class InputStreamUtils extends DefaultMethodsOverrider {
byte[] buffer = new byte[1024];
int length;
while ((length = inputStream.read(buffer)) != -1) byteArrayOutputStream.write(buffer, 0, length);
while ((length = inputStream.read(buffer)) != -1) {
byteArrayOutputStream.write(buffer, 0, length);
}
byteArrayOutputStream.close();
inputStream.close();
return byteArrayOutputStream.toString(StandardCharsets.UTF_8);
return new String(byteArrayOutputStream.toByteArray(), StandardCharsets.UTF_8);
}
public static void downloadFile(String urlStr, File outputFile) throws IOException {