java.lang.Object
java.io.OutputStream
java.io.FilterOutputStream
i2p.susi.util.FixCRLFOutputStream
- All Implemented Interfaces:
Closeable, Flushable, AutoCloseable
OutputStream that converts LF to CRLF during streaming. Used when importing .eml files.
Field Summary
FieldsModifier and TypeFieldDescriptionprivate intThe byte before this one, to recognise a CRLF pair; -1 when there was noneFields inherited from class FilterOutputStream
outConstructor Summary
ConstructorsConstructorDescriptionCreate a FixCRLFOutputStream wrapping the given output stream.Method Summary
All MethodsModifier and TypeMethodDescriptionvoidwrite(int val) Write a single byte, converting LF to CRLF if needed.Methods inherited from class FilterOutputStream
close, flush, write, writeMethods inherited from class OutputStream
nullOutputStream
Field Details
previous
private int previousThe byte before this one, to recognise a CRLF pair; -1 when there was none
Constructor Details
FixCRLFOutputStream
Create a FixCRLFOutputStream wrapping the given output stream.- Parameters:
out- the underlying output stream
Method Details
write
Write a single byte, converting LF to CRLF if needed.- Overrides:
writein classFilterOutputStream- Parameters:
val- the byte value- Throws:
IOException- on I/O error