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
public class FilteredInputStream extends InputStream
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.- Author:
- Pascal Essiembre
-
-
Constructor Summary
Constructors Constructor Description FilteredInputStream(InputStream is, IInputStreamFilter filter)Constructor, using UTF-8 as the character encoding.FilteredInputStream(InputStream is, IInputStreamFilter filter, String encoding)Constructor.FilteredInputStream(InputStream is, IInputStreamFilter filter, Charset encoding)Constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description intread()-
Methods inherited from class java.io.InputStream
available, close, mark, markSupported, nullInputStream, read, read, readAllBytes, readNBytes, readNBytes, reset, skip, transferTo
-
-
-
-
Constructor Detail
-
FilteredInputStream
public FilteredInputStream(InputStream is, IInputStreamFilter filter) throws IOException
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, IInputStreamFilter 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, IInputStreamFilter 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 Detail
-
read
public int read() throws IOException- Specified by:
readin classInputStream- Throws:
IOException
-
-