B2G/gecko/netwerk/test/httpserver/test/head_utils.js
/**
 * Returns the contents of the file as a string.
 *
 * @param file : nsILocalFile
 *   the file whose contents are to be read
 * @returns string
 *   the contents of the file
 */
Returns the contents of the file as a string.
@param file : nsILocalFile
the file whose contents are to be read
@returns string
the contents of the file
Returns the contents of the file as a string . @param file : nsILocalFile the file whose contents are to be read @returns string the contents of the file
function fileContents(file)
{
  const PR_RDONLY = 0x01;
  var fis = new FileInputStream(file, PR_RDONLY, 0444,
                                Ci.nsIFileInputStream.CLOSE_ON_EOF);
  var sis = new ScriptableInputStream(fis);
  var contents = sis.read(file.fileSize);
  sis.close();
  return contents;
}
function fileContents ( file ) { const PR_RDONLY = 0x01 ; var fis = new FileInputStream ( file , PR_RDONLY , 0444 , Ci . nsIFileInputStream . CLOSE_ON_EOF ) ; var sis = new ScriptableInputStream ( fis ) ; var contents = sis . read ( file . fileSize ) ; sis . close ( ) ; return contents ; }
Returns the contents of the file as a string.
Returns the contents of the file as a string .