All Downloads are FREE. Search and download functionalities are using the official Maven repository.

panda.net.io.DotTerminatedMessageWriter Maven / Gradle / Ivy

Go to download

Panda Core is the core module of Panda Framework, it contains commonly used utility classes similar to apache-commons.

There is a newer version: 1.8.0
Show newest version
package panda.net.io;

import java.io.IOException;
import java.io.Writer;

/***
 * DotTerminatedMessageWriter is a class used to write messages to a server that are terminated by a
 * single dot followed by a <CR><LF> 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 * sequence. ***/ public final class DotTerminatedMessageWriter extends CRLFLineWriter { /*** * Creates a DotTerminatedMessageWriter that wraps an existing Writer output destination. * * @param output The Writer output destination to write the message. ***/ public DotTerminatedMessageWriter(Writer output) { super(output); } /** * write end mark * @throws IOException */ protected void end() throws IOException { __output.write(".\r\n"); } }





© 2015 - 2024 Weber Informatics LLC | Privacy Policy