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