Class WindowsLineEndingInputStream

  • All Implemented Interfaces:
    java.io.Closeable, java.lang.AutoCloseable

    public class WindowsLineEndingInputStream
    extends AbstractLineEndingInputStream
    A filtering input stream that ensures the content will have Windows line endings, CRLF.
    Since:
    2.5
    • Field Detail

      • injectSlashLf

        private boolean injectSlashLf
    • Constructor Detail

      • WindowsLineEndingInputStream

        public WindowsLineEndingInputStream​(java.io.InputStream in,
                                            boolean lineFeedAtEos)
        Constructs an input stream that filters another stream.
        Parameters:
        in - The input stream to wrap.
        lineFeedAtEos - true to ensure that the stream ends with CRLF.
    • Method Detail

      • handleEos

        private int handleEos()
        Handles the end of stream condition.
        Returns:
        The next char to output to the stream.
      • read

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