Port FileWriter and ImageFileWriter