org.apache.james.util
Class ExtraDotOutputStream
java.lang.Object
java.io.OutputStream
java.io.FilterOutputStream
org.apache.james.util.ExtraDotOutputStream
- All Implemented Interfaces:
- java.io.Closeable, java.io.Flushable
public class ExtraDotOutputStream
- extends java.io.FilterOutputStream
Adds extra dot if dot occurs in message body at beginning of line (according to RFC1939)
Compare also org.apache.james.smtpserver.SMTPInputStream
Field Summary |
protected int |
countLast0A0D
Counter for number of last (0A or 0D). |
Fields inherited from class java.io.FilterOutputStream |
out |
Constructor Summary |
ExtraDotOutputStream(java.io.OutputStream out)
Constructor that wraps an OutputStream. |
Method Summary |
void |
checkCRLFTerminator()
Ensure that the stream is CRLF terminated. |
void |
write(int b)
Writes a byte to the stream, adding dots where appropriate. |
Methods inherited from class java.io.FilterOutputStream |
close, flush, write, write |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
countLast0A0D
protected int countLast0A0D
- Counter for number of last (0A or 0D).
ExtraDotOutputStream
public ExtraDotOutputStream(java.io.OutputStream out)
- Constructor that wraps an OutputStream.
- Parameters:
out
- the OutputStream to be wrapped
write
public void write(int b)
throws java.io.IOException
- Writes a byte to the stream, adding dots where appropriate.
Also fixes any naked CR or LF to the RFC 2821 mandated CFLF
pairing.
- Overrides:
write
in class java.io.FilterOutputStream
- Parameters:
b
- the byte to write
- Throws:
java.io.IOException
- if an error occurs writing the byte
checkCRLFTerminator
public void checkCRLFTerminator()
throws java.io.IOException
- Ensure that the stream is CRLF terminated.
- Throws:
java.io.IOException
- if an error occurs writing the byte
Copyright © 2002-2007 The Apache Software Foundation. All Rights Reserved.