code: public static FileOutputStream openResultFileOuputStream(
  			Path resultDirectory, String filename) throws IOException {
  		Path filePath = resultDirectory.resolve(filename);
  		return new FileOutputStream(filePath.toFile());
  	}
docs: Opens a new FileOutputStream for a file of the given name in the given
  result directory. Any file of this name that exists already will be
  replaced. The caller is responsible for eventually closing the stream.
  
  @param resultDirectory
  the path to the result directory
  @param filename
  the name of the file to write to
  @return FileOutputStream for the file
  @throws IOException
  if the file or example output directory could not be created