From Java API Specification:
------------------------------------------------------------
FileOutputStream is used for writing streams of raw bytes such as image data. For writing streams of characters, we should go with FileWriter.
Using FileOutputStream:
----------------------------------------------------------
File fout = new File(file_location_string);
FileOutputStream fos = new FileOutputStream(fout);
BufferedWriter out = new BufferedWriter(new OutputStreamWriter(fos));
out.write("something");
Using FileWriter:
---------------------------------------------
FileWriter fstream = new FileWriter(file_location_string);
BufferedWriter out = new BufferedWriter(fstream);
out.write("something");
Both will work, There are a lot of discussion on each of those classes, they both are good implements of file i/o concept that can be found in a general operating systems. However, we don?t care how it is designed, but only how to pick one of them and why pick it that way.
4