Class AutoLFInputStream

  • All Implemented Interfaces:
    Closeable, AutoCloseable

    public class AutoLFInputStream
    extends InputStream
    An InputStream that normalizes CRLF to LF. Existing single CR are not changed to LF, 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).

    This is the former EolCanonicalizingInputStream with a new name in order to have same naming for all LF / CRLF streams

    Since:
    4.3
    • Constructor Detail

      • AutoLFInputStream

        public AutoLFInputStream​(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
      • AutoLFInputStream

        public AutoLFInputStream​(InputStream in,
                                 boolean detectBinary,
                                 boolean abortIfBinary)
        Creates a new InputStream, wrapping the specified stream
        Parameters:
        in - raw input stream
        detectBinary - whether binaries should be detected
        abortIfBinary - throw an IOException if the file is binary
        Since:
        3.3