Output file remained open and could not be accessed

Non command-line applications should not wait for "FileOutputStream out" to be gc-ed before they can access the output file (e.g. to move it to another location in the file system).