Package oracle.i18n.text
Class CharacterValidationReader
- java.lang.Object
-
- java.io.Reader
-
- java.io.FilterReader
-
- oracle.i18n.text.CharacterValidationReader
-
- All Implemented Interfaces:
Closeable,AutoCloseable,Readable
public class CharacterValidationReader extends FilterReader
TheCharacterValidationReaderclass is the validator class that checks the conversion failure, and optionally checks the HTML.Do not use this validator class if the source is allowed to include
U+FFFDsince this validator cannot distinguish whether the0xfffdwas given because of the conversion failure or intentionally being added.- Since:
- 10.2
-
-
Field Summary
-
Fields inherited from class java.io.FilterReader
in
-
-
Constructor Summary
Constructors Constructor Description CharacterValidationReader(Reader r)Constructs this object with theReaderobject.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description intread()Reads a single character.intread(char[] cbuf, int off, int len)Reads characters into a portion of an array.-
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 Detail
-
CharacterValidationReader
public CharacterValidationReader(Reader r) throws IOException
Constructs this object with theReaderobject.By default, HTML character and entity reference is not checked.
- Parameters:
r- the inputReaderobject- Throws:
IOException- if any I/O exception occurs
-
-
Method Detail
-
read
public int read() throws CharConversionException, IOExceptionReads a single character.- Overrides:
readin classFilterReader- Returns:
- the character read, either as an integer in the range
0to65535(0x00-0xffff), or-1if the end of the stream has been reached - Throws:
CharConversionException- if any invalid character is foundIOException- if any other I/O error occurs
-
read
public int read(char[] cbuf, int off, int len) throws CharConversionException, IOExceptionReads characters into a portion of an array.- Overrides:
readin classFilterReader- Parameters:
cbuf- destination bufferoff- offset at which to start storing characterslen- maximum number of characters to read- Returns:
- the number of characters read, or
-1if the end of the stream has been reached - Throws:
CharConversionException- if any invalid character is foundIOException- if any other I/O error occurs
-
-