Package org.subethamail.smtp.io
Class ExtraDotOutputStream
java.lang.Object
java.io.OutputStream
java.io.FilterOutputStream
org.subethamail.smtp.io.CRLFOutputStream
org.subethamail.smtp.io.ExtraDotOutputStream
- All Implemented Interfaces:
Closeable,Flushable,AutoCloseable
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
Fields inherited from class org.subethamail.smtp.io.CRLFOutputStream
LAST_WAS_CR, LAST_WAS_LF, LAST_WAS_OTHER, startOfLine, statusLastFields inherited from class java.io.FilterOutputStream
out -
Constructor Summary
ConstructorsConstructorDescriptionConstructor that wraps an OutputStream. -
Method Summary
Modifier and TypeMethodDescriptionvoidwrite(int b) Writes a byte to the stream, adding dots where appropriate.protected voidwriteChunk(byte[] buffer, int offset, int length) Overrides super writeChunk in order to add a "." if the previous chunk ended with a new line and a new chunk starts with "."Methods inherited from class org.subethamail.smtp.io.CRLFOutputStream
checkCRLFTerminator, writeMethods inherited from class java.io.FilterOutputStream
close, flush, writeMethods inherited from class java.io.OutputStream
nullOutputStream
-
Constructor Details
-
ExtraDotOutputStream
Constructor that wraps an OutputStream.- Parameters:
out- the OutputStream to be wrapped
-
-
Method Details
-
writeChunk
Overrides super writeChunk in order to add a "." if the previous chunk ended with a new line and a new chunk starts with "."- Overrides:
writeChunkin classCRLFOutputStream- Throws:
IOException- See Also:
-
write
Writes a byte to the stream, adding dots where appropriate. Also fixes any naked CR or LF to the RFC 2821 mandated CRLF pairing.- Overrides:
writein classCRLFOutputStream- Parameters:
b- the byte to write- Throws:
IOException- if an error occurs writing the byte
-