Package org.subethamail.smtp.io
Class CRLFTerminatedReader
java.lang.Object
java.io.Reader
org.subethamail.smtp.io.CRLFTerminatedReader
- All Implemented Interfaces:
Closeable,AutoCloseable,Readable
A Reader for use with SMTP or other protocols in which lines
must end with CRLF. Extends Reader and overrides its
readLine() method. The Reader readLine() method cannot
serve for SMTP because it ends lines with either CR or LF alone.
JSS: The readline() method of this class has been 'enchanced' from
the Apache JAMES version to throw an IOException if the line is
greater than or equal to MAX_LINE_LENGTH (998) which is defined
in RFC 2822.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionclassclass -
Field Summary
-
Constructor Summary
Constructors -
Method Summary
Methods inherited from class java.io.Reader
mark, markSupported, nullReader, read, read, reset, skip, transferTo
-
Constructor Details
-
CRLFTerminatedReader
-
CRLFTerminatedReader
- Throws:
UnsupportedEncodingException
-
-
Method Details
-
readLine
Read a line of text which is terminated by CRLF. The concluding CRLF characters are not returned with the String, but if either CR or LF appears in the text in any other sequence it is returned in the String like any other character. Some characters at the end of the stream may be lost if they are in a "line" not terminated by CRLF.- Returns:
- either a String containing the contents of a line which must end with CRLF, or null if the end of the stream has been reached, possibly discarding some characters in a line not terminated with CRLF.
- Throws:
IOException- if an I/O error occurs.
-
read
- Overrides:
readin classReader- Throws:
IOException
-
ready
- Overrides:
readyin classReader- Throws:
IOException
-
read
- Specified by:
readin classReader- Throws:
IOException
-
close
- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable- Specified by:
closein classReader- Throws:
IOException
-