Skip to content

Commit

Permalink
Boost up download game data
Browse files Browse the repository at this point in the history
  • Loading branch information
khanhduytran0 committed Oct 11, 2020
1 parent 00fec73 commit 3d2050c
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 110 deletions.
5 changes: 2 additions & 3 deletions app/src/main/java/net/kdt/pojavlaunch/util/DownloadUtils.java
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
import java.net.*;
import java.nio.charset.*;
import net.kdt.pojavlaunch.*;
import org.apache.commons.io.*;

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

public static void download(URL url, OutputStream os) throws Throwable {
InputStream is = null;
byte[] buf; // 16384
try {
// System.out.println("Connecting: " + url.toString());
HttpURLConnection conn = (HttpURLConnection) url.openConnection();
Expand All @@ -32,9 +32,8 @@ public static void download(URL url, OutputStream os) throws Throwable {
throw new RuntimeException("Server returned HTTP " + conn.getResponseCode()
+ ": " + conn.getResponseMessage());
}
buf = new byte[conn.getContentLength()];
is = conn.getInputStream();
IoUtil.pipe(is, os, buf);
IOUtils.copy(is, os);
} finally {
if (is != null) {
try {
Expand Down
107 changes: 0 additions & 107 deletions app/src/main/java/net/kdt/pojavlaunch/util/IoUtil.java

This file was deleted.

0 comments on commit 3d2050c

Please sign in to comment.