Not all devices work well with streaming

This commit is contained in:
topjohnwu
2017-11-19 06:17:31 +08:00
parent 13dad848bd
commit 334beebfeb
2 changed files with 41 additions and 43 deletions

View File

@@ -225,13 +225,15 @@ public class Utils {
}
}
public static void inToOut(InputStream in, OutputStream out) throws IOException {
int read;
public static int inToOut(InputStream in, OutputStream out) throws IOException {
int read, total = 0;
byte buffer[] = new byte[4096];
while ((read = in.read(buffer)) > 0) {
out.write(buffer, 0, read);
total += read;
}
out.flush();
return total;
}
public static void patchDTBO() {