Class EOLConvertingInputStream
java.lang.Object
java.io.InputStream
org.apache.james.mime4j.io.EOLConvertingInputStream
- All Implemented Interfaces:
Closeable, AutoCloseable
InputStream which converts
\r
bytes not followed by \n and \n not
preceded by \r to \r\n.-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final intConverts single '\r' and '\n' to '\r\n'static final intConverts single '\r' to '\r\n'static final intConverts single '\n' to '\r\n'private intprivate PushbackInputStreamprivate int -
Constructor Summary
ConstructorsConstructorDescriptionCreates a newEOLConvertingInputStreaminstance converting bytes in the givenInputStream.EOLConvertingInputStream(InputStream in, int flags) Creates a newEOLConvertingInputStreaminstance converting bytes in the givenInputStream. -
Method Summary
Methods inherited from class InputStream
available, mark, markSupported, read, read, reset, skip
-
Field Details
-
CONVERT_CR
public static final int CONVERT_CRConverts single '\r' to '\r\n'- See Also:
-
CONVERT_LF
public static final int CONVERT_LFConverts single '\n' to '\r\n'- See Also:
-
CONVERT_BOTH
public static final int CONVERT_BOTHConverts single '\r' and '\n' to '\r\n'- See Also:
-
in
-
previous
private int previous -
flags
private int flags
-
-
Constructor Details
-
EOLConvertingInputStream
Creates a newEOLConvertingInputStreaminstance converting bytes in the givenInputStream. The flagCONVERT_BOTHis the default.- Parameters:
in- theInputStreamto read from.
-
EOLConvertingInputStream
Creates a newEOLConvertingInputStreaminstance converting bytes in the givenInputStream.- Parameters:
in- theInputStreamto read from.flags- one ofCONVERT_CR,CONVERT_LForCONVERT_BOTH.
-
-
Method Details
-
close
Closes the underlying stream.- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable- Overrides:
closein classInputStream- Throws:
IOException- on I/O errors.
-
read
- Specified by:
readin classInputStream- Throws:
IOException- See Also:
-