Package org.apache.commons.io.input
Class WindowsLineEndingInputStream
- java.lang.Object
-
- java.io.InputStream
-
- org.apache.commons.io.input.WindowsLineEndingInputStream
-
- All Implemented Interfaces:
java.io.Closeable
,java.lang.AutoCloseable
public class WindowsLineEndingInputStream extends java.io.InputStream
A filtering input stream that ensures the content will have Windows line endings, CRLF.- Since:
- 2.5
-
-
Constructor Summary
Constructors Constructor Description WindowsLineEndingInputStream(java.io.InputStream in, boolean ensureLineFeedAtEndOfFile)
Creates an input stream that filters another stream
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
close()
Closes the stream.void
mark(int readlimit)
int
read()
-
-
-
Constructor Detail
-
WindowsLineEndingInputStream
public WindowsLineEndingInputStream(java.io.InputStream in, boolean ensureLineFeedAtEndOfFile)
Creates an input stream that filters another stream- Parameters:
in
- The input stream to wrapensureLineFeedAtEndOfFile
- true to ensure that the file ends with CRLF
-
-
Method Detail
-
read
public int read() throws java.io.IOException
- Specified by:
read
in classjava.io.InputStream
- Throws:
java.io.IOException
-
close
public void close() throws java.io.IOException
Closes the stream. Also closes the underlying stream.- Specified by:
close
in interfacejava.lang.AutoCloseable
- Specified by:
close
in interfacejava.io.Closeable
- Overrides:
close
in classjava.io.InputStream
- Throws:
java.io.IOException
- upon error
-
mark
public void mark(int readlimit)
- Overrides:
mark
in classjava.io.InputStream
-
-