Package org.mozilla.universalchardet
Class UniversalDetector
- java.lang.Object
-
- org.mozilla.universalchardet.UniversalDetector
-
public class UniversalDetector extends java.lang.Object
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
UniversalDetector.InputState
-
Field Summary
Fields Modifier and Type Field Description static float
MINIMUM_THRESHOLD
static float
SHORTCUT_THRESHOLD
-
Constructor Summary
Constructors Constructor Description UniversalDetector(CharsetListener listener)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description void
dataEnd()
java.lang.String
getDetectedCharset()
CharsetListener
getListener()
void
handleData(byte[] buf, int offset, int length)
boolean
isDone()
static void
main(java.lang.String[] args)
void
reset()
void
setListener(CharsetListener listener)
-
-
-
Field Detail
-
SHORTCUT_THRESHOLD
public static final float SHORTCUT_THRESHOLD
- See Also:
- Constant Field Values
-
MINIMUM_THRESHOLD
public static final float MINIMUM_THRESHOLD
- See Also:
- Constant Field Values
-
-
Constructor Detail
-
UniversalDetector
public UniversalDetector(CharsetListener listener)
- Parameters:
listener
- a listener object that is notified of the detected encocoding. Can be null.
-
-
Method Detail
-
isDone
public boolean isDone()
-
getDetectedCharset
public java.lang.String getDetectedCharset()
- Returns:
- The detected encoding is returned. If the detector couldn't determine what encoding was used, null is returned.
-
setListener
public void setListener(CharsetListener listener)
-
getListener
public CharsetListener getListener()
-
handleData
public void handleData(byte[] buf, int offset, int length)
-
dataEnd
public void dataEnd()
-
reset
public void reset()
-
main
public static void main(java.lang.String[] args) throws java.lang.Exception
- Throws:
java.lang.Exception
-
-