Package org.mozilla.universalchardet
Class UniversalDetector
- java.lang.Object
-
- org.mozilla.universalchardet.UniversalDetector
-
public final class UniversalDetector extends java.lang.ObjectUniversalDetector.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description private static classUniversalDetector.InputState
-
Field Summary
Fields Modifier and Type Field Description private java.lang.StringdetectedCharsetprivate booleandoneprivate CharsetProberescCharsetProberprivate booleangotDataprivate UniversalDetector.InputStateinputStateprivate bytelastCharprivate static floatMINIMUM_THRESHOLDprivate CharsetProber[]probersprivate booleanstart
-
Constructor Summary
Constructors Constructor Description UniversalDetector()Constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voiddataEnd()Indicate the end of data input.java.lang.StringgetDetectedCharset()Gets the detected charset.voidhandleData(byte[] buf, int offset, int length)Handle data.booleanisDone()Gets the completition status.private voidreset()
-
-
-
Field Detail
-
MINIMUM_THRESHOLD
private static final float MINIMUM_THRESHOLD
- See Also:
- Constant Field Values
-
inputState
private UniversalDetector.InputState inputState
-
done
private boolean done
-
start
private boolean start
-
gotData
private boolean gotData
-
lastChar
private byte lastChar
-
detectedCharset
private java.lang.String detectedCharset
-
probers
private final CharsetProber[] probers
-
escCharsetProber
private CharsetProber escCharsetProber
-
-
Method Detail
-
isDone
public boolean isDone()
Gets the completition status.- Returns:
trueif it is done,falseotherwise.
-
getDetectedCharset
public java.lang.String getDetectedCharset()
Gets the detected charset.- Returns:
- The detected encoding is returned. If the detector couldn't determine what encoding was used, null is returned.
-
handleData
public void handleData(byte[] buf, int offset, int length)Handle data.- Parameters:
buf- Data to handle.offset- Initial data offset.length- Data length.
-
dataEnd
public void dataEnd()
Indicate the end of data input.
-
reset
private void reset()
-
-