Class AutoLFOutputStream
java.lang.Object
java.io.OutputStream
org.eclipse.jgit.util.io.AutoLFOutputStream
- All Implemented Interfaces:
Closeable, Flushable, AutoCloseable
An OutputStream that reduces CRLF to LF.
Existing single CR are not changed to LF, but retained as is.
A binary check on the first 8000 bytes is performed and in case of binary files, canonicalization is turned off (for the complete file). If the binary check determines that the input is not binary but text with CR/LF, canonicalization is also turned off.
- Since:
- 4.3
-
Constructor Summary
ConstructorsConstructorDescriptionConstructor for AutoLFOutputStream.AutoLFOutputStream(OutputStream out, boolean detectBinary) Constructor for AutoLFOutputStream. -
Method Summary
-
Constructor Details
-
AutoLFOutputStream
Constructor for AutoLFOutputStream.- Parameters:
out- anOutputStreamobject.
-
AutoLFOutputStream
Constructor for AutoLFOutputStream.- Parameters:
out- anOutputStreamobject.detectBinary- whether binaries should be detected
-
-
Method Details
-
write
- Specified by:
writein classOutputStream- Throws:
IOException
-
write
- Overrides:
writein classOutputStream- Throws:
IOException
-
write
- Overrides:
writein classOutputStream- Throws:
IOException
-
flush
- Specified by:
flushin interfaceFlushable- Overrides:
flushin classOutputStream- Throws:
IOException
-
close
- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable- Overrides:
closein classOutputStream- Throws:
IOException
-