Package oracle.i18n.lcsd
Class LCSDetectionHTMLReader
- java.lang.Object
-
- java.io.Reader
-
- oracle.i18n.lcsd.LCSDetectionReader
-
- oracle.i18n.lcsd.LCSDetectionHTMLReader
-
- All Implemented Interfaces:
Closeable
,AutoCloseable
,Readable
public class LCSDetectionHTMLReader extends LCSDetectionReader
TheLCSDetectionHTMLReader
class extends theLCSDetectionReader
class to support the language/encoding detection for input in HTML format.You can choose the character set of the HTML meta value or the detected character set value as the input character set with the flag
METAVAL
orDETECTVAL
. The default flag value isDETECTVAL
.The detection sampling length indicates how many bytes of plain text on which the detection feature will perform. The default sampling length is 1K. Generally, LCSD handles the language/encoding detection, and you do not need to set this value. By allowing changes to this value, you can control the detection sampling length.
You can get the detection results from the
LCSDResultSet
class if needed.Any
read
method returnsUTFDataFormatException
if the source is UTF-8 data and an invalid UTF-8 sequence is found.- Since:
- 10.2
-
-
Field Summary
Fields Modifier and Type Field Description static int
DETECTVAL
Constant value to representDETECTVAL
flag.static int
METAVAL
Constant value to representMETAVAL
flag.-
Fields inherited from class oracle.i18n.lcsd.LCSDetectionReader
DEFAULT_SAMPLING_SIZE
-
-
Constructor Summary
Constructors Constructor Description LCSDetectionHTMLReader(InputStream in)
Creates anLCSDetectionHTMLReader
object.LCSDetectionHTMLReader(InputStream in, int len)
Creates anLCSDetectionHTMLReader
object.LCSDetectionHTMLReader(InputStream in, int len, int flag)
Creates anLCSDetectionHTMLReader
object.
-
Method Summary
-
Methods inherited from class oracle.i18n.lcsd.LCSDetectionReader
close, getResult, mark, markSupported, read, read, read, ready, reset
-
Methods inherited from class java.io.Reader
nullReader, read, skip, transferTo
-
-
-
-
Field Detail
-
METAVAL
public static final int METAVAL
Constant value to representMETAVAL
flag.- See Also:
- Constant Field Values
-
DETECTVAL
public static final int DETECTVAL
Constant value to representDETECTVAL
flag.- See Also:
- Constant Field Values
-
-
Constructor Detail
-
LCSDetectionHTMLReader
public LCSDetectionHTMLReader(InputStream in) throws IOException, UTFDataFormatException
Creates anLCSDetectionHTMLReader
object. Use the default sampling length and default profile for detection. The detected character set is used for conversion.- Parameters:
in
- input stream that you want to detect- Throws:
IOException
- if any I/O error occursUTFDataFormatException
- if any invalid UTF-8 data sequence is detected. Note this occurs only if the source is UTF-8 data
-
LCSDetectionHTMLReader
public LCSDetectionHTMLReader(InputStream in, int len) throws IOException, UTFDataFormatException
Creates anLCSDetectionHTMLReader
object. Use the specified sampling length and default profile for detection. The detected character set is used for conversion.- Parameters:
in
- input stream that you want to detectlen
- the sampling length- Throws:
IOException
- if any I/O error occursUTFDataFormatException
- if any invalid UTF-8 data sequence is detected. Note this occurs only if the source is UTF-8 data
-
LCSDetectionHTMLReader
public LCSDetectionHTMLReader(InputStream in, int len, int flag) throws IOException, UTFDataFormatException
Creates anLCSDetectionHTMLReader
object. Use the specified sampling length and default profile for detection. The detected character set is used for conversion if the flag isDETECTVAL
or the meta value of the character set is used for conversion if the flag isMETAVAL
.- Parameters:
in
- input stream that you want to detectlen
- the sampling lengthflag
-METAVAL
orDETECTVAL
- Throws:
IOException
- if any I/O error occursUTFDataFormatException
- if any invalid UTF-8 data sequence is detected. Note this occurs only if the source is UTF-8 data
-
-