| java.lang.Object java.io.Writer org.apache.commons.net.io.DotTerminatedMessageWriter
DotTerminatedMessageWriter | final public class DotTerminatedMessageWriter extends Writer (Code) | | 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.
author: Daniel F. Savarese |
Method Summary | |
public void | close() Flushes the underlying output, writing all buffered output, but doesn't
actually close the underlying stream. | public void | flush() Flushes the underlying output, writing all buffered output. | public void | write(int ch) Writes a character to the output. | public void | write(char[] buffer, int offset, int length) Writes a number of characters from a character array to the output
starting from a given offset. | public void | write(char[] buffer) Writes a character array to the output. | public void | write(String string) Writes a String to the output. | public void | write(String string, int offset, int length) Writes part of a String to the output starting from a given offset. |
DotTerminatedMessageWriter | public DotTerminatedMessageWriter(Writer output)(Code) | | Creates a DotTerminatedMessageWriter that wraps an existing Writer
output destination.
Parameters: output - The Writer output destination to write the message. |
close | public void close() throws IOException(Code) | | 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.
exception: IOException - If an error occurs while writing to the underlyingoutput or closing the Writer. |
flush | public void flush() throws IOException(Code) | | Flushes the underlying output, writing all buffered output.
exception: IOException - If an error occurs while writing to the underlyingoutput. |
write | public void write(int ch) throws IOException(Code) | | 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.
Parameters: ch - The character to write. exception: IOException - If an error occurs while writing to theunderlying output. |
write | public void write(char[] buffer, int offset, int length) throws IOException(Code) | | Writes a number of characters from a character array to the output
starting from a given offset.
Parameters: buffer - The character array to write. Parameters: offset - The offset into the array at which to start copying data. Parameters: length - The number of characters to write. exception: IOException - If an error occurs while writing to the underlyingoutput. |
write | public void write(char[] buffer) throws IOException(Code) | | Writes a character array to the output.
Parameters: buffer - The character array to write. exception: IOException - If an error occurs while writing to the underlyingoutput. |
write | public void write(String string) throws IOException(Code) | | Writes a String to the output.
Parameters: string - The String to write. exception: IOException - If an error occurs while writing to the underlyingoutput. |
write | public void write(String string, int offset, int length) throws IOException(Code) | | Writes part of a String to the output starting from a given offset.
Parameters: string - The String to write. Parameters: offset - The offset into the String at which to start copying data. Parameters: length - The number of characters to write. exception: IOException - If an error occurs while writing to the underlyingoutput. |
|
|