Package oracle.i18n.lcsd
Class LCSDetectionHTMLInputStream
- java.lang.Object
-
- java.io.InputStream
-
- java.io.FilterInputStream
-
- oracle.i18n.lcsd.LCSDetectionInputStream
-
- oracle.i18n.lcsd.LCSDetectionHTMLInputStream
-
- All Implemented Interfaces:
Closeable,AutoCloseable
public class LCSDetectionHTMLInputStream extends LCSDetectionInputStream
TheLCSDetectionHTMLInputStreamclass extends theLCSDetectionInputStreamclass to support the language/encoding detection for input in HTML format.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
LCSDResultSetclass if needed.Any
readmethod returnsUTFDataFormatExceptionif the source is UTF-8 data and an invalid UTF-8 sequence is found.- Since:
- 10.2
-
-
Field Summary
-
Fields inherited from class oracle.i18n.lcsd.LCSDetectionInputStream
DEFAULT_SAMPLING_SIZE
-
Fields inherited from class java.io.FilterInputStream
in
-
-
Constructor Summary
Constructors Constructor Description LCSDetectionHTMLInputStream(InputStream in)Creates anLCSDetectionHTMLInputStreamobject.LCSDetectionHTMLInputStream(InputStream in, int len)Creates anLCSDetectionStreamobject with the specified sampling length.LCSDetectionHTMLInputStream(String name, InputStream in)Creates anLCSDetectionStreamobject with the specified profile for detection.LCSDetectionHTMLInputStream(String name, InputStream in, int len)Creates anLCSDetectionStreamobject with the specified sampling length and the specified profile for detection.
-
Method Summary
-
Methods inherited from class oracle.i18n.lcsd.LCSDetectionInputStream
getResult, read, read, read
-
Methods inherited from class java.io.FilterInputStream
available, close, mark, markSupported, reset, skip
-
Methods inherited from class java.io.InputStream
nullInputStream, readAllBytes, readNBytes, readNBytes, transferTo
-
-
-
-
Constructor Detail
-
LCSDetectionHTMLInputStream
public LCSDetectionHTMLInputStream(InputStream in) throws IOException, UTFDataFormatException
Creates anLCSDetectionHTMLInputStreamobject. Use the default sampling length and default profile for detection.- 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
-
LCSDetectionHTMLInputStream
public LCSDetectionHTMLInputStream(String name, InputStream in) throws IOException, UTFDataFormatException
Creates anLCSDetectionStreamobject with the specified profile for detection. Use the default sampling length.- Parameters:
name- the profile namein- 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
-
LCSDetectionHTMLInputStream
public LCSDetectionHTMLInputStream(InputStream in, int len) throws IOException, UTFDataFormatException
Creates anLCSDetectionStreamobject with the specified sampling length. Use the default profile for detection.- 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
-
LCSDetectionHTMLInputStream
public LCSDetectionHTMLInputStream(String name, InputStream in, int len) throws IOException, UTFDataFormatException
Creates anLCSDetectionStreamobject with the specified sampling length and the specified profile for detection.- Parameters:
name- the profile namein- 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
-
-