Package mireka.pop.command
Class CrLfInputStream
- Object
-
- mireka.pop.command.CrLfInputStream
-
public class CrLfInputStream extends ObjectCrLfInputStream recognizes CR LF line endings but otherwise assumes arbitrary binary content. Mail content is special, because it is considered to be an octet stream, although usually it contains text. MIME mail headers can be encoded in either US-ASCII or UTF-8, but the mail body can be in any charset, moreover it can be arbitrary binary data encoded using the MIME binary method, so the result does not even similar to text. The POP3 TOP command needs to return mail headers and a few lines of the body. The latter is obsolete functionality, there may be no lines in the body, but we have to deal with this situation.
-
-
Constructor Summary
Constructors Constructor Description CrLfInputStream(java.io.InputStream in)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description intreadLineWithEol(byte[] buffer)Reads a line without end-of-line characters.
-
-
-
Method Detail
-
readLineWithEol
public int readLineWithEol(byte[] buffer) throws org.subethamail.smtp.io.CRLFTerminatedReader.MaxLineLengthException, java.io.IOExceptionReads a line without end-of-line characters. It recognizes but logs line endings other then CR LF.- Throws:
org.subethamail.smtp.io.CRLFTerminatedReader.MaxLineLengthException- if the line is longer than the length of the bufferjava.io.IOException
-
-