mirror of
https://gitlab.bixilon.de/bixilon/minosoft.git
synced 2025-09-12 00:47:26 -04:00
Util: set buffer size to 4096
This commit is contained in:
parent
5315681395
commit
16ef8d7b06
@ -196,7 +196,7 @@ public class AssetsManager {
|
||||
// ToDo: use input steam twice ?
|
||||
ByteArrayOutputStream outputBuffer = new ByteArrayOutputStream();
|
||||
int len;
|
||||
byte[] buffer = new byte[2048];
|
||||
byte[] buffer = new byte[4096];
|
||||
while ((len = versionJar.read(buffer)) > 0) {
|
||||
outputBuffer.write(buffer, 0, len);
|
||||
}
|
||||
|
@ -78,7 +78,7 @@ public class StartProgressWindow extends Application {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void start(Stage stage) throws Exception {
|
||||
public void start(Stage stage) {
|
||||
toolkitLatch.countDown();
|
||||
}
|
||||
}
|
||||
|
@ -88,7 +88,7 @@ public final class Util {
|
||||
ByteArrayOutputStream outputStream = new ByteArrayOutputStream();
|
||||
|
||||
int res = 0;
|
||||
byte[] buf = new byte[1024];
|
||||
byte[] buf = new byte[4096];
|
||||
while (res >= 0) {
|
||||
res = gzipInputStream.read(buf, 0, buf.length);
|
||||
if (res > 0) {
|
||||
@ -209,11 +209,10 @@ public final class Util {
|
||||
copyFile(getInputStreamByURL(url), new GZIPOutputStream(new FileOutputStream(destination)));
|
||||
}
|
||||
|
||||
|
||||
public static void copyFile(InputStream inputStream, OutputStream output) throws IOException {
|
||||
byte[] buffer = new byte[1024];
|
||||
byte[] buffer = new byte[4096];
|
||||
int length;
|
||||
while ((length = inputStream.read(buffer, 0, 1024)) != -1) {
|
||||
while ((length = inputStream.read(buffer, 0, 4096)) != -1) {
|
||||
output.write(buffer, 0, length);
|
||||
}
|
||||
inputStream.close();
|
||||
|
Loading…
x
Reference in New Issue
Block a user