Android: difference between FileOutputStream and FileWriter

I was wondering exactly what the difference is between Android FileOutputStream and the FileWriter class. When would it be most appropriate to use each of them?

+7
source share
1 answer

If I remember correctly, FileOutputStream is a more general purpose - it can be used for binary data or text data. FileWriter is used only for text.

http://docs.oracle.com/javase/1.4.2/docs/api/java/io/FileWriter.html

FileWriter is designed to record character streams. To write raw byte streams, consider using FileOutputStream.

+8
source

All Articles