Only use required memory size
This commit is contained in:
parent
5109b9abfd
commit
3e3f38500d
@ -147,7 +147,7 @@ public class InstallMagisk extends ParallelTask<Void, Void, Boolean> {
|
||||
console.add("- Downloading zip");
|
||||
HttpURLConnection conn = WebService.mustRequest(Data.magiskLink, null);
|
||||
buf = new BufferedInputStream(new ProgressStream(conn), conn.getContentLength());
|
||||
buf.mark(Integer.MAX_VALUE);
|
||||
buf.mark(conn.getContentLength());
|
||||
try (OutputStream out = new FileOutputStream(zip)) {
|
||||
ShellUtils.pump(buf, out);
|
||||
}
|
||||
@ -156,7 +156,7 @@ public class InstallMagisk extends ParallelTask<Void, Void, Boolean> {
|
||||
} else {
|
||||
console.add("- Existing zip found");
|
||||
buf = new BufferedInputStream(new FileInputStream(zip), (int) zip.length());
|
||||
buf.mark(Integer.MAX_VALUE);
|
||||
buf.mark((int) zip.length());
|
||||
}
|
||||
|
||||
console.add("- Extracting files");
|
||||
|
Loading…
Reference in New Issue
Block a user