- java.lang.Object
-
- java.io.InputStream
-
- org.eclipse.jgit.util.io.AutoCRLFInputStream
-
- All Implemented Interfaces:
Closeable,AutoCloseable
public class AutoCRLFInputStream extends InputStream
An InputStream that expands LF to CRLF. Existing CRLF are not expanded to CRCRLF, but retained as is. Optionally, 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 AutoCRLFInputStream(InputStream in, boolean detectBinary)Creates a new InputStream, wrapping the specified stream
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidclose()intread()intread(byte[] bs, int off, int len)-
Methods inherited from class java.io.InputStream
available, mark, markSupported, nullInputStream, read, readAllBytes, readNBytes, readNBytes, reset, skip, transferTo
-
-
-
-
Constructor Detail
-
AutoCRLFInputStream
public AutoCRLFInputStream(InputStream in, boolean detectBinary)
Creates a new InputStream, wrapping the specified stream- Parameters:
in- raw input streamdetectBinary- whether binaries should be detected- Since:
- 2.0
-
-
Method Detail
-
read
public int read() throws IOException- Specified by:
readin classInputStream- Throws:
IOException
-
read
public int read(byte[] bs, int off, int len) throws IOException- Overrides:
readin classInputStream- Throws:
IOException
-
close
public void close() throws IOException- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable- Overrides:
closein classInputStream- Throws:
IOException
-
-