Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit f342ac91 authored by Brad Fitzpatrick's avatar Brad Fitzpatrick Committed by Android Git Automerger
Browse files

am 8443dd16: am 383e95e2: Merge "DropBox: Read until the end of stream has been reached"

* commit '8443dd16':
  DropBox: Read until the end of stream has been reached
parents 4e74e181 8443dd16
Loading
Loading
Loading
Loading
+6 −1
Original line number Diff line number Diff line
@@ -169,7 +169,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 {