Package com.norconex.commons.lang.io
Class FilteredInputStream
java.lang.Object
java.io.InputStream
com.norconex.commons.lang.io.FilteredInputStream
- All Implemented Interfaces:
Closeable,AutoCloseable
Decorates an InputStream with a stream filter. The stream filter
allows to control which line of text is being returned by the decorated
instance when read.
-
Constructor Summary
ConstructorsConstructorDescriptionFilteredInputStream(InputStream is, Predicate<String> filter) Constructor, using UTF-8 as the character encoding.FilteredInputStream(InputStream is, Predicate<String> filter, String encoding) Constructor.FilteredInputStream(InputStream is, Predicate<String> filter, Charset encoding) Constructor. -
Method Summary
Methods inherited from class java.io.InputStream
available, close, mark, markSupported, nullInputStream, read, read, readAllBytes, readNBytes, readNBytes, reset, skip, skipNBytes, transferTo
-
Constructor Details
-
FilteredInputStream
Constructor, using UTF-8 as the character encoding.- Parameters:
is- input stream to filterfilter- the filter to apply- Throws:
IOException- i/o problem
-
FilteredInputStream
public FilteredInputStream(InputStream is, Predicate<String> filter, Charset encoding) throws IOException Constructor.- Parameters:
is- input stream to filterfilter- the filter to applyencoding- character encoding- Throws:
IOException- i/o problem- Since:
- 1.14.0
-
FilteredInputStream
public FilteredInputStream(InputStream is, Predicate<String> filter, String encoding) throws IOException Constructor.- Parameters:
is- input stream to filterfilter- the filter to applyencoding- character encoding- Throws:
IOException- i/o problem- Since:
- 1.5.0
-
-
Method Details
-
read
- Specified by:
readin classInputStream- Throws:
IOException
-