Aspects


vs


Home Page
About Us

Fileoutputstream

FileOutputStream is a Java class used to write bytes directly to a File or to a FileDescriptor.

Filewriter

Java built-in class that allows writing character files.



Others

Example

Usually better than filewriter already suggested is to use fileoutputstream which also like filewriter has an append parameter in one of filewriter constructors and which unlike filewriter does not silently assume the default charset encoding slightly bad practice imo

from question  

Java I/O: How to append to an already existing text file

If i remember correctly fileoutputstream is more general purpose - it can be used for binary data or text data;filewriter is used for text only

from question  

Android: Difference between FileOutputStream and FileWriter

You need to create a fileoutputstream and decorates it with printstream or better filewriter with printwriter

from question  

Writing System.Out.Println into text file

Back to Home
Data comes from Stack Exchange with CC-BY-SA-4.0