- java.lang.Object
-
- java.io.OutputStream
-
- org.eclipse.jgit.util.io.AutoCRLFOutputStream
-
- All Implemented Interfaces:
Closeable,Flushable,AutoCloseable
public class AutoCRLFOutputStream extends OutputStream
An OutputStream that expands LF to CRLF. Existing CRLF are not expanded to CRCRLF, but retained as is. A binary check on the firstRawText.getBufferSize()bytes is performed and in case of binary files, canonicalization is turned off (for the complete file).
-
-
Constructor Summary
Constructors Constructor Description AutoCRLFOutputStream(OutputStream out)Constructor for AutoCRLFOutputStream.AutoCRLFOutputStream(OutputStream out, boolean detectBinary)Constructor for AutoCRLFOutputStream.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidclose()voidflush()voidwrite(byte[] b)voidwrite(byte[] b, int startOff, int startLen)voidwrite(int b)-
Methods inherited from class java.io.OutputStream
nullOutputStream
-
-
-
-
Constructor Detail
-
AutoCRLFOutputStream
public AutoCRLFOutputStream(OutputStream out)
Constructor for AutoCRLFOutputStream.
- Parameters:
out- aOutputStreamobject.
-
AutoCRLFOutputStream
public AutoCRLFOutputStream(OutputStream out, boolean detectBinary)
Constructor for AutoCRLFOutputStream.
- Parameters:
out- aOutputStreamobject.detectBinary- whether binaries should be detected- Since:
- 4.3
-
-
Method Detail
-
write
public void write(int b) throws IOException- Specified by:
writein classOutputStream- Throws:
IOException
-
write
public void write(byte[] b) throws IOException- Overrides:
writein classOutputStream- Throws:
IOException
-
write
public void write(byte[] b, int startOff, int startLen) throws IOException- Overrides:
writein classOutputStream- Throws:
IOException
-
flush
public void flush() throws IOException- Specified by:
flushin interfaceFlushable- Overrides:
flushin classOutputStream- Throws:
IOException
-
close
public void close() throws IOException- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable- Overrides:
closein classOutputStream- Throws:
IOException
-
-