Package org.eclipse.jgit.util.io
Class AutoCRLFOutputStream
java.lang.Object
java.io.OutputStream
org.eclipse.jgit.util.io.AutoCRLFOutputStream
- All Implemented Interfaces:
Closeable,Flushable,AutoCloseable
An OutputStream that expands LF to CRLF.
Existing CRLF are not expanded to CRCRLF, but retained as is.
A binary check on the first
RawText.getBufferSize() bytes is
performed and in case of binary files, canonicalization is turned off (for
the complete file).-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate byte[]private intprivate intprivate booleanprivate booleanprivate byte[]private final OutputStream -
Constructor Summary
ConstructorsConstructorDescriptionConstructor for AutoCRLFOutputStream.AutoCRLFOutputStream(OutputStream out, boolean detectBinary) Constructor for AutoCRLFOutputStream. -
Method Summary
Methods inherited from class java.io.OutputStream
nullOutputStream
-
Field Details
-
out
-
buf
private int buf -
binbuf
private byte[] binbuf -
onebytebuf
private byte[] onebytebuf -
binbufcnt
private int binbufcnt -
detectBinary
private boolean detectBinary -
isBinary
private boolean isBinary
-
-
Constructor Details
-
AutoCRLFOutputStream
Constructor for AutoCRLFOutputStream.
- Parameters:
out- aOutputStreamobject.
-
AutoCRLFOutputStream
Constructor for AutoCRLFOutputStream.
- Parameters:
out- aOutputStreamobject.detectBinary- whether binaries should be detected- Since:
- 4.3
-
-
Method Details
-
write
- Specified by:
writein classOutputStream- Throws:
IOException
-
write
- Overrides:
writein classOutputStream- Throws:
IOException
-
write
- Overrides:
writein classOutputStream- Throws:
IOException
-
buffer
- Throws:
IOException
-
decideMode
- 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
-