You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cordova.apache.org by br...@apache.org on 2013/01/08 17:37:11 UTC

docs commit: Add documentation for File.slice()

Updated Branches:
  refs/heads/master af24b6ce1 -> 79725f558


Add documentation for File.slice()


Project: http://git-wip-us.apache.org/repos/asf/cordova-docs/repo
Commit: http://git-wip-us.apache.org/repos/asf/cordova-docs/commit/79725f55
Tree: http://git-wip-us.apache.org/repos/asf/cordova-docs/tree/79725f55
Diff: http://git-wip-us.apache.org/repos/asf/cordova-docs/diff/79725f55

Branch: refs/heads/master
Commit: 79725f5580120a2b16d2a3d23def7c33b98a1ed1
Parents: af24b6c
Author: Braden Shepherdson <br...@chromium.org>
Authored: Tue Jan 8 11:36:52 2013 -0500
Committer: Braden Shepherdson <br...@chromium.org>
Committed: Tue Jan 8 11:36:52 2013 -0500

----------------------------------------------------------------------
 docs/en/edge/cordova/file/fileobj/fileobj.md |   35 +++++++++++++++++++++
 1 files changed, 35 insertions(+), 0 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cordova-docs/blob/79725f55/docs/en/edge/cordova/file/fileobj/fileobj.md
----------------------------------------------------------------------
diff --git a/docs/en/edge/cordova/file/fileobj/fileobj.md b/docs/en/edge/cordova/file/fileobj/fileobj.md
index 5639ec3..a24ff82 100644
--- a/docs/en/edge/cordova/file/fileobj/fileobj.md
+++ b/docs/en/edge/cordova/file/fileobj/fileobj.md
@@ -31,6 +31,11 @@ Properties
 - __lastModifiedDate:__ The last time the file was modified. _(Date)_
 - __size:__ The size of the file in bytes. _(long)_
 
+Methods
+-------
+
+- __slice__: Select only a portion of the file to be read.
+
 Details
 -------
 
@@ -44,3 +49,33 @@ Supported Platforms
 - iOS
 - Windows Phone 7 and 8
 - Windows 8
+
+
+slice
+--------------
+
+Return a new File object, for which FileReader will return only the specified portion of the file.
+Negative values for __start__ or __end__ are measured from the end of the file.
+The indexes are always relative to the current slice (see the full example).
+
+__Parameters:__
+
+- __start__ - The index of the first byte to read, inclusive.
+- __end__ - The index of the byte after the last one to read.
+
+__Quick Example__
+
+    var slicedFile = file.slice(10, 30);
+
+__Full Example__
+
+    var slice1 = file.slice(100, 400);
+    var slice2 = slice1.slice(20, 35);
+    
+    var slice3 = file.slice(120, 135);
+    // slice2 and slice3 are equivalent.
+
+__Supported Platforms:__
+
+- Android
+- iOS