org.apache.commons.io.input

## Class CharacterFilterReader

- java.lang.Object
- - java.io.Reader
  - - java.io.FilterReader
    - - org.apache.commons.io.input.AbstractCharacterFilterReader
      - - org.apache.commons.io.input.CharacterFilterReader

- All Implemented Interfaces:
    Closeable, AutoCloseable, Readable

      public class CharacterFilterReader
      extends AbstractCharacterFilterReader

  A filter reader that filters out a given character represented as an `int` code point, handy to remove known junk characters from CSV files for example. This class is the most efficient way to filter out a single character, as opposed to using a `CharacterSetFilterReader`. You can also nest `CharacterFilterReader`s.

- - ### Field Summary

    - ### Fields inherited from class org.apache.commons.io.input.AbstractCharacterFilterReader

      `SKIP_NONE`

    - ### Fields inherited from class java.io.FilterReader

      `in`

    - ### Fields inherited from class java.io.Reader

      `lock`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `CharacterFilterReader(Reader reader, int skip)` Constructs a new reader.
    `CharacterFilterReader(Reader reader, IntPredicate skip)` Constructs a new reader.

  - ### Method Summary

    - ### Methods inherited from class org.apache.commons.io.input.AbstractCharacterFilterReader

      `filter, read, read`

    - ### Methods inherited from class java.io.FilterReader

      `close, mark, markSupported, ready, reset, skip`

    - ### Methods inherited from class java.io.Reader

      `read, read`

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Constructor Detail

    - #### CharacterFilterReader

          public CharacterFilterReader(Reader reader,
                                       int skip)

      Constructs a new reader.
      Parameters:
        `reader` - the reader to filter.
        `skip` - the character to filter out.

    - #### CharacterFilterReader

          public CharacterFilterReader(Reader reader,
                                       IntPredicate skip)

      Constructs a new reader.
      Parameters:
        `reader` - the reader to filter.
        `skip` - Skip test.
      Since:
        2.9.0

Copyright © 2002–2023 The Apache Software Foundation. All rights reserved.