You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cordova.apache.org by ag...@apache.org on 2015/03/11 16:35:24 UTC

[13/13] cordova-plugin-file git commit: android: Don't use LimitedInputStream when reading entire file (optimization)

android: Don't use LimitedInputStream when reading entire file (optimization)


Project: http://git-wip-us.apache.org/repos/asf/cordova-plugin-file/repo
Commit: http://git-wip-us.apache.org/repos/asf/cordova-plugin-file/commit/80cf1de4
Tree: http://git-wip-us.apache.org/repos/asf/cordova-plugin-file/tree/80cf1de4
Diff: http://git-wip-us.apache.org/repos/asf/cordova-plugin-file/diff/80cf1de4

Branch: refs/heads/master
Commit: 80cf1de400b43ab64facc821f5354beb34f412f3
Parents: 072acc7
Author: Andrew Grieve <ag...@chromium.org>
Authored: Tue Mar 10 22:50:58 2015 -0400
Committer: Andrew Grieve <ag...@chromium.org>
Committed: Wed Mar 11 11:35:08 2015 -0400

----------------------------------------------------------------------
 src/android/Filesystem.java | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cordova-plugin-file/blob/80cf1de4/src/android/Filesystem.java
----------------------------------------------------------------------
diff --git a/src/android/Filesystem.java b/src/android/Filesystem.java
index 45047c8..46786f3 100644
--- a/src/android/Filesystem.java
+++ b/src/android/Filesystem.java
@@ -263,7 +263,10 @@ public abstract class Filesystem {
             if (start > 0) {
                 ofrr.inputStream.skip(start);
             }
-            LimitedInputStream inputStream = new LimitedInputStream(ofrr.inputStream, numBytesToRead);
+            InputStream inputStream = ofrr.inputStream;
+            if (end < ofrr.length) {
+                inputStream = new LimitedInputStream(inputStream, numBytesToRead);
+            }
             readFileCallback.handleData(inputStream, ofrr.mimeType);
         } finally {
             ofrr.inputStream.close();


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@cordova.apache.org
For additional commands, e-mail: commits-help@cordova.apache.org