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.
  • Constructor Details

    • FilteredInputStream

      public FilteredInputStream(InputStream is, Predicate<String> filter) throws IOException
      Constructor, using UTF-8 as the character encoding.
      Parameters:
      is - input stream to filter
      filter - 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 filter
      filter - the filter to apply
      encoding - 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 filter
      filter - the filter to apply
      encoding - character encoding
      Throws:
      IOException - i/o problem
      Since:
      1.5.0
  • Method Details