B2G/gecko/toolkit/components/osfile/osfile_shared_front.jsm
/**
   * Read bytes from this file to a new buffer.
   *
   * @param {number=} bytes If unspecified, read all the remaining bytes from
   * this file. If specified, read |bytes| bytes, or less if the file does not
   * contain that many bytes.
   * @return {Uint8Array} An array containing the bytes read.
   */
Read bytes from this file to a new buffer.
@param {number=} bytes If unspecified, read all the remaining bytes from
this file. If specified, read |bytes| bytes, or less if the file does not
contain that many bytes.
@return {Uint8Array} An array containing the bytes read.
Read bytes from this file to a new buffer . @param { number = } bytes If unspecified read all the remaining bytes from this file . If specified read |bytes| bytes or less if the file does not contain that many bytes . @return { Uint8Array } An array containing the bytes read .
function read(bytes) {
    if (bytes == null) {
      bytes = this.stat().size;
    }
    let buffer = new Uint8Array(bytes);
    let size = this.readTo(buffer, bytes);
    if (size == bytes) {
      return buffer;
    } else {
      return buffer.subarray(0, size);
    }
  }
function read ( bytes ) { if ( bytes == null ) { bytes = this . stat ( ) . size ; } let buffer = new Uint8Array ( bytes ) ; let size = this . readTo ( buffer , bytes ) ; if ( size == bytes ) { return buffer ; } else { return buffer . subarray ( 0 , size ) ; } }
Read bytes from this file to a new buffer.
Read bytes from this file to a new buffer .