Class AutoCRLFInputStream
java.lang.Object
java.io.InputStream
org.eclipse.jgit.util.io.AutoCRLFInputStream
- All Implemented Interfaces:
Closeable, AutoCloseable
An InputStream that expands LF to CRLF.
Existing CRLF are not expanded to CRCRLF, but retained as is.
Optionally, 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 final byte[](package private) static final intprivate intprivate booleanprivate final InputStreamprivate booleanprivate byteprivate intprivate final byte[] -
Constructor Summary
ConstructorsConstructorDescriptionAutoCRLFInputStream(InputStream in, boolean detectBinary) Creates a new InputStream, wrapping the specified stream -
Method Summary
Methods inherited from class InputStream
available, mark, markSupported, read, reset, skip
-
Field Details
-
BUFFER_SIZE
static final int BUFFER_SIZE- See Also:
-
single
private final byte[] single -
buf
private final byte[] buf -
in
-
cnt
private int cnt -
ptr
private int ptr -
isBinary
private boolean isBinary -
detectBinary
private boolean detectBinary -
last
private byte last
-
-
Constructor Details
-
AutoCRLFInputStream
Creates a new InputStream, wrapping the specified stream- Parameters:
in- raw input streamdetectBinary- whether binaries should be detected- Since:
- 2.0
-
-
Method Details
-
read
- Specified by:
readin classInputStream- Throws:
IOException
-
read
- Overrides:
readin classInputStream- Throws:
IOException
-
close
- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable- Overrides:
closein classInputStream- Throws:
IOException
-
fillBuffer
- Throws:
IOException
-