org.subethamail.smtp.io
Class DotTerminatedOutputStream

java.lang.Object
  extended by java.io.OutputStream
      extended by org.subethamail.smtp.io.DotTerminatedOutputStream
All Implemented Interfaces:
Closeable, Flushable

public class DotTerminatedOutputStream
extends OutputStream

DotTerminatedOutputStream makes possible to end mail data with a "CRLF . CRLF" sequence in such a way that no unnecessary beginning CRLF pair is added if the original output already ends with it. See RFC 5321 4.1.1.4. second paragraph


Constructor Summary
DotTerminatedOutputStream(OutputStream out)
           
 
Method Summary
 void write(byte[] b, int off, int len)
           
 void write(int b)
           
 void writeTerminatingSequence()
          Writes ".
 
Methods inherited from class java.io.OutputStream
close, flush, write
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DotTerminatedOutputStream

public DotTerminatedOutputStream(OutputStream out)
Method Detail

write

public void write(int b)
           throws IOException
Specified by:
write in class OutputStream
Throws:
IOException

write

public void write(byte[] b,
                  int off,
                  int len)
           throws IOException
Overrides:
write in class OutputStream
Throws:
IOException

writeTerminatingSequence

public void writeTerminatingSequence()
                              throws IOException
Writes ". CR LF" to the wrapped stream, but prefixes it with another CR LF sequence if it is missing from the end.

Throws:
IOException


Copyright © 2006-2012. All Rights Reserved.