function onReadFileRequested(options, onSuccess, onError) {
  var filePath = openedFiles[options.openRequestId];
  if (options.fileSystemId !== test_util.FILE_SYSTEM_ID || !filePath) {
    onError('INVALID_OPERATION');  // enum ProviderError.
    return;
  }

  if (filePath === '/' + TESTING_6GB_FILE.name) {
    if (options.offset < TESTING_TEXT_OFFSET ||
        options.offset >= TESTING_TEXT_OFFSET + TESTING_TEXT.length) {
      console.error('Reading from a wrong location in the file!');
      onError('FAILED');  // enum ProviderError.
      return;
    }

    var buffer = TESTING_TEXT.substr(
        options.offset - TESTING_TEXT_OFFSET, options.length);
    var reader = new FileReader();
    reader.onload = function(e) {
      onSuccess(e.target.result, false /* hasMore */);
    };
    reader.readAsArrayBuffer(new Blob([buffer]));
    return;
  }

  onError('INVALID_OPERATION');  // enum ProviderError.
}
/**
 * Requests reading contents of a file, previously opened with <code>
 * openRequestId</code>.
 *
 * @param {ReadFileRequestedOptions} options Options.
 * @param {function(ArrayBuffer, boolean)} onSuccess Success callback with a
 *     chunk of data, and information if more data will be provided later.
 * @param {function(string)} onError Error callback.
 */
Requests reading contents of a file, previously opened with
openRequestId.

@param {ReadFileRequestedOptions} options Options.
@param {function(ArrayBuffer, boolean)} onSuccess Success callback with a
chunk of data, and information if more data will be provided later.
@param {function(string)} onError Error callback.
Requests reading contents of a file previously opened with openRequestId . @param { ReadFileRequestedOptions } options Options . @param { function ( ArrayBuffer boolean ) } onSuccess Success callback with a chunk of data and information if more data will be provided later . @param { function ( string ) } onError Error callback .
function onReadFileRequested(options, onSuccess, onError) {
  var filePath = openedFiles[options.openRequestId];
  if (options.fileSystemId !== test_util.FILE_SYSTEM_ID || !filePath) {
    onError('INVALID_OPERATION');  
    return;
  }
  if (filePath === '/' + TESTING_6GB_FILE.name) {
    if (options.offset < TESTING_TEXT_OFFSET ||
        options.offset >= TESTING_TEXT_OFFSET + TESTING_TEXT.length) {
      console.error('Reading from a wrong location in the file!');
      onError('FAILED');  
      return;
    }
    var buffer = TESTING_TEXT.substr(
        options.offset - TESTING_TEXT_OFFSET, options.length);
    var reader = new FileReader();
    reader.onload = function(e) {
      onSuccess(e.target.result, false );
    };
    reader.readAsArrayBuffer(new Blob([buffer]));
    return;
  }
  onError('INVALID_OPERATION');  
}
function onReadFileRequested ( options , onSuccess , onError ) { var filePath = openedFiles [ options . openRequestId ] ; if ( options . fileSystemId !== test_util . FILE_SYSTEM_ID || ! filePath ) { onError ( 'INVALID_OPERATION' ) ; return ; } if ( filePath === '/' + TESTING_6GB_FILE . name ) { if ( options . offset < TESTING_TEXT_OFFSET || options . offset >= TESTING_TEXT_OFFSET + TESTING_TEXT . length ) { console . error ( 'Reading from a wrong location in the file!' ) ; onError ( 'FAILED' ) ; return ; } var buffer = TESTING_TEXT . substr ( options . offset - TESTING_TEXT_OFFSET , options . length ) ; var reader = new FileReader ( ) ; reader . onload = function ( e ) { onSuccess ( e . target . result , false ) ; } ; reader . readAsArrayBuffer ( new Blob ( [ buffer ] ) ) ; return ; } onError ( 'INVALID_OPERATION' ) ; }
Requests reading contents of a file, previously opened with <code>
 openRequestId</code>.
Requests reading contents of a file previously opened with <code > openRequestId< / code > .
// enum ProviderError. // enum ProviderError. /* hasMore */ // enum ProviderError.