dog.mail.util
Class MessageOutputStream
java.lang.Object
|
+--java.io.OutputStream
|
+--java.io.FilterOutputStream
|
+--dog.mail.util.MessageOutputStream
- public class MessageOutputStream
- extends java.io.FilterOutputStream
An output stream that escapes any dots on a line by themself with
another dot, for the purposes of sending messages to SMTP and NNTP servers.
Field Summary |
static int |
END
The stream termination octet. |
static int |
LF
The line termination octet. |
Fields inherited from class java.io.FilterOutputStream |
out |
Constructor Summary |
MessageOutputStream(java.io.OutputStream out)
Constructs a message output stream connected to the specified output stream. |
Method Summary |
void |
write(byte[] b,
int off,
int len)
Writes a portion of a byte array to the underlying stream. |
void |
write(int ch)
Writes a character to the underlying stream. |
Methods inherited from class java.io.FilterOutputStream |
close,
flush,
write |
Methods inherited from class java.lang.Object |
clone,
equals,
finalize,
getClass,
hashCode,
notify,
notifyAll,
toString,
wait,
wait,
wait |
END
public static final int END
- The stream termination octet.
LF
public static final int LF
- The line termination octet.
MessageOutputStream
public MessageOutputStream(java.io.OutputStream out)
- Constructs a message output stream connected to the specified output stream.
- Parameters:
out
- the target output stream
write
public void write(int ch)
throws java.io.IOException
- Writes a character to the underlying stream.
- Throws:
- java.io.IOException - if an I/O error occurred
- Overrides:
- write in class java.io.FilterOutputStream
write
public void write(byte[] b,
int off,
int len)
throws java.io.IOException
- Writes a portion of a byte array to the underlying stream.
- Throws:
- java.io.IOException - if an I/O error occurred
- Overrides:
- write in class java.io.FilterOutputStream