mirror of
https://github.com/topjohnwu/Magisk
synced 2024-11-13 20:54:12 +01:00
Small net update
This commit is contained in:
parent
036b5acf42
commit
0c7a95bdf6
@ -15,10 +15,9 @@ import java.io.FileOutputStream;
|
||||
import java.io.FilterInputStream;
|
||||
import java.io.IOException;
|
||||
import java.io.InputStream;
|
||||
import java.io.InputStreamReader;
|
||||
import java.io.OutputStream;
|
||||
import java.io.Reader;
|
||||
import java.net.HttpURLConnection;
|
||||
import java.util.Scanner;
|
||||
import java.util.concurrent.Executor;
|
||||
|
||||
public class Request implements Closeable {
|
||||
@ -192,16 +191,11 @@ public class Request implements Closeable {
|
||||
}
|
||||
|
||||
private String dlString() throws IOException {
|
||||
StringBuilder builder = new StringBuilder();
|
||||
try (Reader reader = new InputStreamReader(getInputStream())) {
|
||||
int len;
|
||||
char[] buf = new char[4096];
|
||||
while ((len = reader.read(buf)) != -1) {
|
||||
builder.append(buf, 0, len);
|
||||
try (Scanner s = new Scanner(getInputStream(), "UTF-8")) {
|
||||
s.useDelimiter("\\A");
|
||||
return s.next();
|
||||
}
|
||||
}
|
||||
return builder.toString();
|
||||
}
|
||||
|
||||
private JSONObject dlJSONObject() throws IOException, JSONException {
|
||||
return new JSONObject(dlString());
|
||||
|
Loading…
Reference in New Issue
Block a user