Class AutoCRLFInputStream

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 first RawText.getBufferSize() bytes is performed and in case of binary files, canonicalization is turned off (for the complete file).
  • Field Details

    • single

      private final byte[] single
    • buf

      private final byte[] buf
    • in

      private final InputStream in
    • cnt

      private int cnt
    • ptr

      private int ptr
    • isBinary

      private boolean isBinary
    • detectBinary

      private boolean detectBinary
    • last

      private byte last
  • Constructor Details

    • AutoCRLFInputStream

      public AutoCRLFInputStream(InputStream in, boolean detectBinary)
      Creates a new InputStream, wrapping the specified stream
      Parameters:
      in - raw input stream
      detectBinary - whether binaries should be detected
      Since:
      2.0
  • Method Details