DotTerminatedMessageWriter is a class used to write messages to a
server that are terminated by a single dot followed by a
sequence and with double dots appearing at the begining of lines which
do not signal end of message yet start with a dot. Various Internet
protocols such as NNTP and POP3 produce messages of this type.
This class handles the doubling of line-starting periods,
converts single linefeeds to NETASCII newlines, and on closing
will send the final message terminator dot and NETASCII newline
Writes a character to the output. Note that a call to this method
may result in multiple writes to the underling Writer in order to
convert naked linefeeds to NETASCII line separators and to double
line-leading periods. This is transparent to the programmer and
is only mentioned for completeness.
Flushes the underlying output, writing all buffered output, but doesn't
actually close the underlying stream. The underlying stream may still
be used for communicating with the server and therefore is not closed.