summaryrefslogtreecommitdiffstats
path: root/core
diff options
context:
space:
mode:
Diffstat (limited to 'core')
-rw-r--r--core/java/android/os/DropBoxManager.java7
1 files changed, 6 insertions, 1 deletions
diff --git a/core/java/android/os/DropBoxManager.java b/core/java/android/os/DropBoxManager.java
index a9f9bd7..c46a42d 100644
--- a/core/java/android/os/DropBoxManager.java
+++ b/core/java/android/os/DropBoxManager.java
@@ -168,7 +168,12 @@ public class DropBoxManager {
is = getInputStream();
if (is == null) return null;
byte[] buf = new byte[maxBytes];
- return new String(buf, 0, Math.max(0, is.read(buf)));
+ int readBytes = 0;
+ int n = 0;
+ while (n >= 0 && (readBytes += n) < maxBytes) {
+ n = is.read(buf, readBytes, maxBytes - readBytes);
+ }
+ return new String(buf, 0, readBytes);
} catch (IOException e) {
return null;
} finally {