gnu.inet.util
Class MessageOutputStream

java.lang.Object
  extended by java.io.OutputStream
      extended by java.io.FilterOutputStream
          extended by gnu.inet.util.MessageOutputStream
All Implemented Interfaces:
java.io.Closeable, java.io.Flushable

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.

Author:
Chris Burdess

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[] bytes)
           
 void write(byte[] bytes, int off, int len)
          Block write.
 void write(int c)
          Character write.
 
Methods inherited from class java.io.FilterOutputStream
close, flush
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

END

public static final int END
The stream termination octet.

See Also:
Constant Field Values

LF

public static final int LF
The line termination octet.

See Also:
Constant Field Values
Constructor Detail

MessageOutputStream

public MessageOutputStream(java.io.OutputStream out)
Constructs a message output stream connected to the specified output stream.

Parameters:
out - the target output stream
Method Detail

write

public void write(int c)
           throws java.io.IOException
Character write.

Overrides:
write in class java.io.FilterOutputStream
Throws:
java.io.IOException

write

public void write(byte[] bytes)
           throws java.io.IOException
Overrides:
write in class java.io.FilterOutputStream
Throws:
java.io.IOException

write

public void write(byte[] bytes,
                  int off,
                  int len)
           throws java.io.IOException
Block write.

Overrides:
write in class java.io.FilterOutputStream
Throws:
java.io.IOException


© Copyright 2003 The Free Software Foundation, all rights reserved