Changed behavior when writing the file to the socket channel.