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 8000 bytes is performed and in case of binary
files, canonicalization is turned off (for the complete file).
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate byte[]
private int
private int
(package private) static final int
private boolean
private boolean
private byte[]
private final OutputStream
-
Constructor Summary
ConstructorsConstructorDescriptionConstructor for AutoCRLFOutputStream.AutoCRLFOutputStream
(OutputStream out, boolean detectBinary) Constructor for AutoCRLFOutputStream. -
Method Summary
-
Field Details
-
BUFFER_SIZE
static final int BUFFER_SIZE- See Also:
-
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
- aOutputStream
object.
-
AutoCRLFOutputStream
Constructor for AutoCRLFOutputStream.
- Parameters:
out
- aOutputStream
object.detectBinary
- whether binaries should be detected- Since:
- 4.3
-
-
Method Details
-
write
- Specified by:
write
in classOutputStream
- Throws:
IOException
-
write
- Overrides:
write
in classOutputStream
- Throws:
IOException
-
write
- Overrides:
write
in classOutputStream
- Throws:
IOException
-
buffer
- Throws:
IOException
-
decideMode
- Throws:
IOException
-
flush
- Specified by:
flush
in interfaceFlushable
- Overrides:
flush
in classOutputStream
- Throws:
IOException
-
close
- Specified by:
close
in interfaceAutoCloseable
- Specified by:
close
in interfaceCloseable
- Overrides:
close
in classOutputStream
- Throws:
IOException
-