Constructs a writer that encodes characters according to the given charset and writes the resulting bytes to the given channel.
An invocation of this method of the form
Channels.newWriter(ch, charset)
behaves in exactly the same way as the expression
Channels.newWriter(ch, Charset.forName(csName).newEncoder(), -1)
The writer's default action for malformed-input and unmappable-character errors is to report them. When more control over the error handling is required, the constructor that takes a CharsetEncoder should be used.