org.eclipse.jgit.util.io
Class AutoCRLFInputStream

java.lang.Object
  extended by java.io.InputStream
      extended by org.eclipse.jgit.util.io.AutoCRLFInputStream
All Implemented Interfaces:
Closeable

public class AutoCRLFInputStream
extends InputStream

An OutputStream 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).


Constructor Summary
AutoCRLFInputStream(InputStream in, boolean detectBinary)
          Creates a new InputStream, wrapping the specified stream
 
Method Summary
 void close()
           
 int read()
           
 int read(byte[] bs, int off, int len)
           
 
Methods inherited from class java.io.InputStream
available, mark, markSupported, read, reset, skip
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

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 Detail

read

public int read()
         throws IOException
Specified by:
read in class InputStream
Throws:
IOException

read

public int read(byte[] bs,
                int off,
                int len)
         throws IOException
Overrides:
read in class InputStream
Throws:
IOException

close

public void close()
           throws IOException
Specified by:
close in interface Closeable
Overrides:
close in class InputStream
Throws:
IOException


Copyright © 2012. All Rights Reserved.