mirror of
https://github.com/topjohnwu/Magisk.git
synced 2025-04-02 07:52:15 +00:00
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");
|
console.add("- Downloading zip");
|
||||||
HttpURLConnection conn = WebService.mustRequest(Data.magiskLink, null);
|
HttpURLConnection conn = WebService.mustRequest(Data.magiskLink, null);
|
||||||
buf = new BufferedInputStream(new ProgressStream(conn), conn.getContentLength());
|
buf = new BufferedInputStream(new ProgressStream(conn), conn.getContentLength());
|
||||||
buf.mark(Integer.MAX_VALUE);
|
buf.mark(conn.getContentLength());
|
||||||
try (OutputStream out = new FileOutputStream(zip)) {
|
try (OutputStream out = new FileOutputStream(zip)) {
|
||||||
ShellUtils.pump(buf, out);
|
ShellUtils.pump(buf, out);
|
||||||
}
|
}
|
||||||
@ -156,7 +156,7 @@ public class InstallMagisk extends ParallelTask<Void, Void, Boolean> {
|
|||||||
} else {
|
} else {
|
||||||
console.add("- Existing zip found");
|
console.add("- Existing zip found");
|
||||||
buf = new BufferedInputStream(new FileInputStream(zip), (int) zip.length());
|
buf = new BufferedInputStream(new FileInputStream(zip), (int) zip.length());
|
||||||
buf.mark(Integer.MAX_VALUE);
|
buf.mark((int) zip.length());
|
||||||
}
|
}
|
||||||
|
|
||||||
console.add("- Extracting files");
|
console.add("- Extracting files");
|
||||||
|
Loading…
x
Reference in New Issue
Block a user