org.riotfamily.common.io
Class XmlCharRangeFilterReader
java.lang.Object
java.io.Reader
java.io.FilterReader
org.riotfamily.common.io.XmlCharRangeFilterReader
- All Implemented Interfaces:
- Closeable, Readable
public class XmlCharRangeFilterReader
- extends FilterReader
FilterReader that silently swallows invalid XML characters like 0xb or 0x1a.
- Since:
- 8.0
- Author:
- Felix Gnass [fgnass at neteye dot de]
Method Summary |
protected boolean |
isValidXmlChar(int c)
Returns whether the given unicode character is valid according to the
XML 1.0 standard. |
int |
read()
|
int |
read(char[] cbuf,
int off,
int len)
Reads characters into a portion of an array. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
XmlCharRangeFilterReader
public XmlCharRangeFilterReader(Reader in)
isValidXmlChar
protected boolean isValidXmlChar(int c)
- Returns whether the given unicode character is valid according to the
XML 1.0 standard.
- See Also:
http://www.w3.org/TR/2000/REC-xml-20001006#NT-Char
read
public int read()
throws IOException
- Overrides:
read
in class FilterReader
- Throws:
IOException
read
public int read(char[] cbuf,
int off,
int len)
throws IOException
- Reads characters into a portion of an array.
- Overrides:
read
in class FilterReader
- Parameters:
cbuf
- Destination bufferoff
- Offset at which to start storing characterslen
- Maximum number of characters to read
- Returns:
- The number of characters read, or -1 if the end of the
stream has been reached
- Throws:
IOException
- If an I/O error occurs