Package 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:
java.io.Closeable
,java.lang.AutoCloseable
,java.lang.Readable
public class CharacterFilterReader extends AbstractCharacterFilterReader
A filter reader that filters out a given character represented as anint
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 aCharacterSetFilterReader
. You can also nestCharacterFilterReader
s.
-
-
Field Summary
Fields Modifier and Type Field Description private int
skip
-
Constructor Summary
Constructors Constructor Description CharacterFilterReader(java.io.Reader reader, int skip)
Constructs a new reader.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected boolean
filter(int ch)
Returns true if the given character should be filtered out, false to keep the character.-
Methods inherited from class org.apache.commons.io.input.AbstractCharacterFilterReader
read, read
-
-
-
-
Method Detail
-
filter
protected boolean filter(int ch)
Description copied from class:AbstractCharacterFilterReader
Returns true if the given character should be filtered out, false to keep the character.- Specified by:
filter
in classAbstractCharacterFilterReader
- Parameters:
ch
- the character to test.- Returns:
- true if the given character should be filtered out, false to keep the character.
-
-