Class FileWriterWithEncoding

All Implemented Interfaces:
Closeable, Flushable, Appendable, AutoCloseable

public class FileWriterWithEncoding extends ProxyWriter
Writer of files that allows the encoding to be set.

This class provides a simple alternative to FileWriter that allows an encoding to be set. Unfortunately, it cannot subclass FileWriter.

By default, the file will be overwritten, but this may be changed to append.

The encoding must be specified using either the name of the Charset, the Charset, or a CharsetEncoder. If the default encoding is required then use the FileWriter directly, rather than this implementation.

To build an instance, use FileWriterWithEncoding.Builder.

Since:
1.4
See Also: