Close the write channel.
Destroy the channel.
Flush the output.
Writes as much data as possible to the output.
See Implementation