lib/Ext/device/filesystem/HTML5.js
function(config) {
                var me = this;
                this.getEntry(
                    {
                        success: function(fileEntry) {
                            fileEntry.file(
                                function(file) {
                                    if (Ext.isNumber(config.length)) {
                                        if (Ext.isFunction(file.slice)) {
                                            file = file.slice(me.offset, config.length);
                                        } else {
                                            if (config.failure) {
                                                config.failure.call(config.scope || me, {code: -2, message: "File missing slice functionality"});
                                            }
                                            return;
                                        }
                                    }

                                    var reader = new FileReader();
                                    reader.onloadend = function(evt) {
                                        config.success.call(config.scope || me, evt.target.result);
                                    };

                                    reader.onerror = function(error) {
                                        config.failure.call(config.scope || me, error);
                                    };

                                    if (config.reader) {
                                        reader = Ext.applyIf(reader, config.reader);
                                    }

                                    config.encoding = config.encoding || "UTF8";

                                    switch (config.type) {
                                        default:
                                        case "text":
                                            reader.readAsText(file, config.encoding);
                                            break;
                                        case "dataURL":
                                            reader.readAsDataURL(file);
                                            break;
                                        case "binaryString":
                                            reader.readAsBinaryString(file);
                                            break;
                                        case "arrayBuffer":
                                            reader.readAsArrayBuffer(file);
                                            break;
                                    }
                                },
                                function(error) {
                                    config.failure.call(config.scope || me, error)
                                }
                            );
                        },
                        failure: function(error) {
                            config.failure.call(config.scope || me, error)
                        }
                    }
                )
            }
function(config) {
                var me = this;
                this.getEntry(
                    {
                        success: function(fileEntry) {
                            fileEntry.file(
                                function(file) {
                                    if (Ext.isNumber(config.length)) {
                                        if (Ext.isFunction(file.slice)) {
                                            file = file.slice(me.offset, config.length);
                                        } else {
                                            if (config.failure) {
                                                config.failure.call(config.scope || me, {code: -2, message: "File missing slice functionality"});
                                            }
                                            return;
                                        }
                                    }

                                    var reader = new FileReader();
                                    reader.onloadend = function(evt) {
                                        config.success.call(config.scope || me, evt.target.result);
                                    };

                                    reader.onerror = function(error) {
                                        config.failure.call(config.scope || me, error);
                                    };

                                    if (config.reader) {
                                        reader = Ext.applyIf(reader, config.reader);
                                    }

                                    config.encoding = config.encoding || "UTF8";

                                    switch (config.type) {
                                        default:
                                        case "text":
                                            reader.readAsText(file, config.encoding);
                                            break;
                                        case "dataURL":
                                            reader.readAsDataURL(file);
                                            break;
                                        case "binaryString":
                                            reader.readAsBinaryString(file);
                                            break;
                                        case "arrayBuffer":
                                            reader.readAsArrayBuffer(file);
                                            break;
                                    }
                                },
                                function(error) {
                                    config.failure.call(config.scope || me, error)
                                }
                            );
                        },
                        failure: function(error) {
                            config.failure.call(config.scope || me, error)
                        }
                    }
                )
            }
Reads the data from the file starting at the file offset.

@param {Object} config
The object which contains the following config options:

@param {Number} config.length This is optional.
The length of bytes to read from the file. Defaults to the file's current size if unspecified.

@param {String} config.encoding
Optional encoding type used only for reading as Text

@param {String} config.type
Type of reading to use options are "text" (default), "dataURL", "binaryString" and "arrayBuffer"

@param {Object} config.reader
Optional config params to be applied to a File Reader

@param {Function} config.reader.onloadstart
@param {Function} config.reader.onloadprogress
@param {Function} config.reader.onload
@param {Function} config.reader.onabort
@param {Function} config.reader.onerror
@param {Function} config.reader.onloadend

@param {Function} config.success This is optional.
The callback to be called when the data has been successfully read.

@param {Object} config.success.data
The read data.

@param {Function} config.failure This is optional.
The callback to be called when an error occurred.

@param {Object} config.failure.error
The occurred error.

@param {Object} config.scope
The scope object