Class UniversalDetector
java.lang.Object
org.mozilla.universalchardet.UniversalDetector
UniversalDetector.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionprivate static enum///////////////////////////////////////////////////////////// -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate Stringprivate booleanprivate CharsetProberprivate booleanprivate UniversalDetector.InputState/////////////////////////////////////////////////////////////private byteprivate static final float/////////////////////////////////////////////////////////////private final CharsetProber[]private boolean -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoiddataEnd()Indicate the end of data input.Gets the detected charset.voidhandleData(byte[] buf, int offset, int length) Handle data.booleanisDone()Gets the completition status.private voidreset()
-
Field Details
-
MINIMUM_THRESHOLD
private static final float MINIMUM_THRESHOLD/////////////////////////////////////////////////////////////- See Also:
-
inputState
///////////////////////////////////////////////////////////// -
done
private boolean done -
start
private boolean start -
gotData
private boolean gotData -
lastChar
private byte lastChar -
detectedCharset
-
probers
-
escCharsetProber
-
-
Constructor Details
-
UniversalDetector
public UniversalDetector()Constructor.
-
-
Method Details
-
isDone
public boolean isDone()Gets the completition status.- Returns:
trueif it is done,falseotherwise.
-
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()
-