Package org.apache.commons.io.input
Class CharacterSetFilterReader
- java.lang.Object
-
- java.io.Reader
-
- java.io.FilterReader
-
- org.apache.commons.io.input.AbstractCharacterFilterReader
-
- org.apache.commons.io.input.CharacterSetFilterReader
-
- All Implemented Interfaces:
java.io.Closeable,java.lang.AutoCloseable,java.lang.Readable
public class CharacterSetFilterReader extends AbstractCharacterFilterReader
A filter reader that removes a given set of characters represented asintcode points, handy to remove known junk characters from CSV files for example.This class must convert each
intread to anInteger. You can increase the Integer cache with a system property, seeInteger.
-
-
Constructor Summary
Constructors Constructor Description CharacterSetFilterReader(java.io.Reader reader, java.util.Set<java.lang.Integer> skip)Constructs a new reader.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected booleanfilter(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:AbstractCharacterFilterReaderReturns true if the given character should be filtered out, false to keep the character.- Specified by:
filterin classAbstractCharacterFilterReader- Parameters:
ch- the character to test.- Returns:
- true if the given character should be filtered out, false to keep the character.
-
-