Package org.apache.commons.io.input
Class UnixLineEndingInputStream
- java.lang.Object
-
- java.io.InputStream
-
- org.apache.commons.io.input.UnixLineEndingInputStream
-
- All Implemented Interfaces:
Closeable
,AutoCloseable
public class UnixLineEndingInputStream extends InputStream
A filtering input stream that ensures the content will have unix-style line endings, LF.- Since:
- 2.5
-
-
Constructor Summary
Constructors Constructor Description UnixLineEndingInputStream(InputStream in, boolean ensureLineFeedAtEndOfFile)
Create 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()
-
Methods inherited from class java.io.InputStream
available, markSupported, nullInputStream, read, read, readAllBytes, readNBytes, readNBytes, reset, skip, transferTo
-
-
-
-
Constructor Detail
-
UnixLineEndingInputStream
public UnixLineEndingInputStream(InputStream in, boolean ensureLineFeedAtEndOfFile)
Create an input stream that filters another stream- Parameters:
in
- The input stream to wrapensureLineFeedAtEndOfFile
- true to ensure that the file ends with LF
-
-
Method Detail
-
read
public int read() throws IOException
- Specified by:
read
in classInputStream
- Throws:
IOException
-
close
public void close() throws IOException
Closes the stream. Also closes the underlying stream.- Specified by:
close
in interfaceAutoCloseable
- Specified by:
close
in interfaceCloseable
- Overrides:
close
in classInputStream
- Throws:
IOException
- upon error
-
mark
public void mark(int readlimit)
- Overrides:
mark
in classInputStream
-
-