Add Headings and they will appear in your table of contents.
Extends OutputStreamWriter.
Converts data of characters to data of bytes for a StreamWriter (any subclasses). Therefore, it is a bridge between character streams and byte streams, writes characters to an output stream as bytes.
Its purpose is to read data in characters from a file.
In case a method tries to access data after the end of the source (accessed length is greater than the actually available), exception raises.
The stream must be closed after processing in order to release the output stream.
After closing the stream, any method will raise exception.
The FileWriter implements the AutoClosable interface, the try-with-resources statement can be used to ensure proper closing.
Constructor parameters:
(String fileName): links the FileWriter to file based upon its file name, default character coding
(String fileName, Charset charset): same as previous but charset character coding
(File file): links the FileWriter to file based upon its file object, default character coding
(File file, Charset charset): same as previous but charset character coding
The defined character coding will be forced during accessing the destination stream.
Available methods are below.
EXAMPLE FOR USAGE:
EXAMPLE FOR USAGE WITH TRY-WITH-RESOURCES:
EXAMPLE FOR USING CHARACTER CODINGS: