Class CharacterSetFilterReader

All Implemented Interfaces:
Closeable, AutoCloseable, Readable

A filter reader that removes a given set of characters represented as int code points, handy to remove known junk characters from CSV files for example.

This class must convert each int read to an Integer. You can increase the Integer cache with a system property, see Integer.

  • Constructor Details

    • CharacterSetFilterReader

      public CharacterSetFilterReader(Reader reader, Integer... skip)
      Constructs a new reader.
      Parameters:
      reader - the reader to filter.
      skip - the set of characters to filter out.
      Since:
      2.9.0
    • CharacterSetFilterReader

      public CharacterSetFilterReader(Reader reader, Set<Integer> skip)
      Constructs a new reader.
      Parameters:
      reader - the reader to filter.
      skip - the set of characters to filter out.