Package org.eclipse.jgit.util.io
Class AutoCRLFInputStream
- java.lang.Object
-
- java.io.InputStream
-
- org.eclipse.jgit.util.io.AutoCRLFInputStream
-
- All Implemented Interfaces:
java.io.Closeable
,java.lang.AutoCloseable
public class AutoCRLFInputStream extends java.io.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(java.io.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 void
close()
private boolean
fillBuffer()
int
read()
int
read(byte[] bs, int off, int len)
-
-
-
Method Detail
-
read
public int read() throws java.io.IOException
- Specified by:
read
in classjava.io.InputStream
- Throws:
java.io.IOException
-
read
public int read(byte[] bs, int off, int len) throws java.io.IOException
- Overrides:
read
in classjava.io.InputStream
- Throws:
java.io.IOException
-
close
public void close() throws java.io.IOException
- Specified by:
close
in interfacejava.lang.AutoCloseable
- Specified by:
close
in interfacejava.io.Closeable
- Overrides:
close
in classjava.io.InputStream
- Throws:
java.io.IOException
-
fillBuffer
private boolean fillBuffer() throws java.io.IOException
- Throws:
java.io.IOException
-
-