public class CharacterSetFilterReader extends AbstractCharacterFilterReader
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
.
in
Constructor and Description |
---|
CharacterSetFilterReader(Reader reader,
Set<Integer> skip)
Constructs a new reader.
|
Modifier and Type | Method and Description |
---|---|
protected boolean |
filter(int ch)
Returns true if the given character should be filtered out, false to keep the character.
|
read, read
close, mark, markSupported, ready, reset, skip
public CharacterSetFilterReader(Reader reader, Set<Integer> skip)
reader
- the reader to filter.skip
- the set of characters to filter out.protected boolean filter(int ch)
AbstractCharacterFilterReader
filter
in class AbstractCharacterFilterReader
ch
- the character to test.Copyright © 2002–2020 The Apache Software Foundation. All rights reserved.