Package org.apache.commons.io.input
Class UnixLineEndingInputStream
- java.lang.Object
-
- java.io.InputStream
-
- org.apache.commons.io.input.UnixLineEndingInputStream
-
- All Implemented Interfaces:
java.io.Closeable,java.lang.AutoCloseable
public class UnixLineEndingInputStream extends java.io.InputStreamA filtering input stream that ensures the content will have UNIX-style line endings, LF.- Since:
- 2.5
-
-
Constructor Summary
Constructors Constructor Description UnixLineEndingInputStream(java.io.InputStream inputStream, boolean ensureLineFeedAtEndOfFile)Constructs an input stream that filters another stream
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidclose()Closes the stream.voidmark(int readLimit)intread()
-
-
-
Constructor Detail
-
UnixLineEndingInputStream
public UnixLineEndingInputStream(java.io.InputStream inputStream, boolean ensureLineFeedAtEndOfFile)Constructs an input stream that filters another stream- Parameters:
inputStream- The input stream to wrapensureLineFeedAtEndOfFile- true to ensure that the file ends with LF
-
-
Method Detail
-
close
public void close() throws java.io.IOExceptionCloses the stream. Also closes the underlying stream.- Specified by:
closein interfacejava.lang.AutoCloseable- Specified by:
closein interfacejava.io.Closeable- Overrides:
closein classjava.io.InputStream- Throws:
java.io.IOException- upon error
-
mark
public void mark(int readLimit)
- Overrides:
markin classjava.io.InputStream
-
read
public int read() throws java.io.IOException- Specified by:
readin classjava.io.InputStream- Throws:
java.io.IOException
-
-