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:
Closeable
,AutoCloseable
,Readable
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 java.io.FilterReader
in
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected 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
Methods inherited from class java.io.FilterReader
close, mark, markSupported, ready, reset, skip
Methods inherited from class java.io.Reader
nullReader, read, read, transferTo
-
Constructor Details
-
CharacterFilterReader
Constructs a new reader.- Parameters:
reader
- the reader to filter.skip
- the character to filter out.
-
-
Method Details
-
filter
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.
-