- java.lang.Object
-
- java.io.InputStream
-
- org.shredzone.acme4j.connector.TrimmingInputStream
-
- All Implemented Interfaces:
Closeable
,AutoCloseable
public class TrimmingInputStream extends InputStream
Normalizes line separators in an InputStream. Converts all line separators to '\n'. Multiple line separators are compressed to a single line separator. Leading line separators are removed. Trailing line separators are compressed to a single separator.
-
-
Constructor Summary
Constructors Constructor Description TrimmingInputStream(InputStream in)
Creates a newTrimmingInputStream
.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description int
available()
void
close()
int
read()
-
Methods inherited from class java.io.InputStream
mark, markSupported, nullInputStream, read, read, readAllBytes, readNBytes, readNBytes, reset, skip, transferTo
-
-
-
-
Constructor Detail
-
TrimmingInputStream
public TrimmingInputStream(InputStream in)
Creates a newTrimmingInputStream
.- Parameters:
in
-InputStream
to read from. Will be closed when this stream is closed.
-
-
Method Detail
-
read
public int read() throws IOException
- Specified by:
read
in classInputStream
- Throws:
IOException
-
available
public int available() throws IOException
- Overrides:
available
in classInputStream
- Throws:
IOException
-
close
public void close() throws IOException
- Specified by:
close
in interfaceAutoCloseable
- Specified by:
close
in interfaceCloseable
- Overrides:
close
in classInputStream
- Throws:
IOException
-
-