oracle.i18n.text
Class CharacterValidationReader
java.lang.Object
|
+--java.io.Reader
|
+--java.io.FilterReader
|
+--oracle.i18n.text.CharacterValidationReader
- public class CharacterValidationReader
- extends FilterReader
The CharacterValidationReader
class 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+FFFD
since this validator cannot distinguish whether the 0xfffd
was given because of the conversion failure or intentionally being added.
- Since:
- 10.2
Method Summary |
int |
read()
Reads a single character. |
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 |
CharacterValidationReader
public CharacterValidationReader(Reader r)
throws IOException
- Constructs this object with the
Reader
object.
By default, HTML character and entity reference is not checked.
- Parameters:
r
- the input Reader
object
- Throws:
IOException
- if any I/O exception occurs
read
public int read()
throws CharConversionException,
IOException
- Reads a single character.
-
- Overrides:
read
in class FilterReader
-
- Returns:
- the character read, either as an integer in the range
0
to 65535
(0x00-0xffff
), or -1
if the end of the stream has been reached
- Throws:
CharConversionException
- if any invalid character is found
IOException
- if any other I/O error occurs
read
public int read(char[] cbuf,
int off,
int len)
throws CharConversionException,
IOException
- Reads characters into a portion of an array.
-
- Overrides:
read
in class FilterReader
-
- Parameters:
cbuf
- destination buffer
off
- offset at which to start storing characters
len
- maximum number of characters to read
- Returns:
- the number of characters read, or
-1
if the end of the stream has been reached
- Throws:
CharConversionException
- if any invalid character is found
IOException
- if any other I/O error occurs
Copyright © 2003, 2005, Oracle. All rights reserved.