Skip to content
This repository was archived by the owner on Sep 23, 2025. It is now read-only.

Commit 3d2050c

Browse files
committed
Boost up download game data
1 parent 00fec73 commit 3d2050c

2 files changed

Lines changed: 2 additions & 110 deletions

File tree

app/src/main/java/net/kdt/pojavlaunch/util/DownloadUtils.java

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
import java.net.*;
66
import java.nio.charset.*;
77
import net.kdt.pojavlaunch.*;
8+
import org.apache.commons.io.*;
89

910
public class DownloadUtils {
1011
public static final String USER_AGENT = Tools.APP_NAME;
@@ -20,7 +21,6 @@ public static void download(String url, OutputStream os) {
2021

2122
public static void download(URL url, OutputStream os) throws Throwable {
2223
InputStream is = null;
23-
byte[] buf; // 16384
2424
try {
2525
// System.out.println("Connecting: " + url.toString());
2626
HttpURLConnection conn = (HttpURLConnection) url.openConnection();
@@ -32,9 +32,8 @@ public static void download(URL url, OutputStream os) throws Throwable {
3232
throw new RuntimeException("Server returned HTTP " + conn.getResponseCode()
3333
+ ": " + conn.getResponseMessage());
3434
}
35-
buf = new byte[conn.getContentLength()];
3635
is = conn.getInputStream();
37-
IoUtil.pipe(is, os, buf);
36+
IOUtils.copy(is, os);
3837
} finally {
3938
if (is != null) {
4039
try {

app/src/main/java/net/kdt/pojavlaunch/util/IoUtil.java

Lines changed: 0 additions & 107 deletions
This file was deleted.

0 commit comments

Comments
 (0)