public final class DotTerminatedMessageWriter
extends java.io.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.
| 构造器和说明 |
|---|
DotTerminatedMessageWriter(java.io.Writer output)
Creates a DotTerminatedMessageWriter that wraps an existing Writer
output destination.
|
| 限定符和类型 | 方法和说明 |
|---|---|
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(char[] buffer)
Writes a character array 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(int ch)
Writes a character to the output.
|
void |
write(java.lang.String string)
Writes a String to the output.
|
void |
write(java.lang.String string,
int offset,
int length)
Writes part of a String to the output starting from a given offset.
|
public DotTerminatedMessageWriter(java.io.Writer output)
output - The Writer output destination to write the message.public void write(int ch)
throws java.io.IOException
write 在类中 java.io.Writerch - The character to write.java.io.IOException - If an error occurs while writing to the
underlying output.public void write(char[] buffer,
int offset,
int length)
throws java.io.IOException
write 在类中 java.io.Writerbuffer - The character array to write.offset - The offset into the array at which to start copying data.length - The number of characters to write.java.io.IOException - If an error occurs while writing to the underlying
output.public void write(char[] buffer)
throws java.io.IOException
write 在类中 java.io.Writerbuffer - The character array to write.java.io.IOException - If an error occurs while writing to the underlying
output.public void write(java.lang.String string)
throws java.io.IOException
write 在类中 java.io.Writerstring - The String to write.java.io.IOException - If an error occurs while writing to the underlying
output.public void write(java.lang.String string,
int offset,
int length)
throws java.io.IOException
write 在类中 java.io.Writerstring - The String to write.offset - The offset into the String at which to start copying data.length - The number of characters to write.java.io.IOException - If an error occurs while writing to the underlying
output.public void flush()
throws java.io.IOException
flush 在接口中 java.io.Flushableflush 在类中 java.io.Writerjava.io.IOException - If an error occurs while writing to the underlying
output.public void close()
throws java.io.IOException
close 在接口中 java.io.Closeableclose 在接口中 java.lang.AutoCloseableclose 在类中 java.io.Writerjava.io.IOException - If an error occurs while writing to the underlying
output or closing the Writer.