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