Seek into local files with the File System API
bookmark_borderbookmark
Stay organized with collections
Save and categorize content based on your preferences.
If you have a File
object (say, one stored using the FileSystem API), it's possible to seek into it and read chunks without reading the entire file into memory:
var url = "filesystem:http://example.com/temporary/myfile.zip";
window.webkitResolveLocalFileSystemURL(url, function(fileEntry) {
fileEntry.file(function(file) {
var reader = new FileReader();
reader.onload = function(e) {
var ab = e.target.result; // arrayBuffer containing bytes 0-10 of file.
var uInt8Arr = new Uint8Array(ab);
...
};
var blob = file.webkitSlice(0, 10, "application/zip"); // mimetype is optional
reader.readAsArrayBuffer(blob);
}, errorHandler);
}, errorHandler);
Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License, and code samples are licensed under the Apache 2.0 License. For details, see the Google Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2011-08-04 UTC.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2011-08-04 UTC."],[],[]]