mirror of
https://github.com/moonlight-stream/moonlight-android.git
synced 2026-10-21 15:56:57 +00:00
Fix some caching bugs
This commit is contained in:
1 parent
72d3576257
commit
a490da5e5c
3 files changed
+29
-18
No files matched your search
@@ -38,12 +38,14 @@ public class CacheHelper {
|
||||
return new FileOutputStream(openPath(true, root, path));
|
||||
}
|
||||
|
||||
public static String readInputStreamToString(InputStream in) {
|
||||
Scanner s = new Scanner(in);
|
||||
public static String readInputStreamToString(InputStream in) throws IOException {
|
||||
Reader r = new InputStreamReader(in);
|
||||
|
||||
StringBuilder sb = new StringBuilder();
|
||||
while (s.hasNext()) {
|
||||
sb.append(s.next());
|
||||
char[] buf = new char[256];
|
||||
int bytesRead;
|
||||
while ((bytesRead = r.read(buf)) != -1) {
|
||||
sb.append(buf, 0, bytesRead);
|
||||
}
|
||||
|
||||
return sb.toString();
|
||||
|
||||
Reference in new issue
Block a user