OutputStreamWriter
OutputStreamWriter is a bridge from character streams to byte streams in Java I/O. It writes characters to an underlying OutputStream by encoding the characters into bytes using a specified charset. As a subclass of Writer, it participates in the character stream API and can be used wherever a Writer is expected.
Constructors allow different ways to specify the encoding: OutputStreamWriter(OutputStream out), OutputStreamWriter(OutputStream out, Charset cs), and OutputStreamWriter(OutputStream
Encoding behavior: OutputStreamWriter relies on a CharsetEncoder to convert characters to bytes. If a character cannot
Performance and usage notes: OutputStreamWriter performs no buffering by itself. For improved performance when writing many
Common usage: To write text to a file, create a FileOutputStream and wrap it with an OutputStreamWriter,