Class RotatingCharsetDetector
java.lang.Object
org.archive.format.text.charset.CharsetDetector
org.archive.format.text.charset.RotatingCharsetDetector
- Author:
- brad Provides a way to rotate through several detection schemes
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final intstatic final intstatic final int[][]Fields inherited from class org.archive.format.text.charset.CharsetDetector
CHARSET_TOKEN, DEFAULT_CHARSET, HTTP_CONTENT_TYPE_HEADER, MAX_CHARSET_READAHEAD -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiongetCharset(byte[] buffer, int len, HttpHeaders headers) intnextMode(int curMode) Methods inherited from class org.archive.format.text.charset.CharsetDetector
contentTypeToCharset, findMetaContentType, getCharsetFromBytes, getCharsetFromHeaders, getCharsetFromMeta, isCharsetSupported, mapCharset
-
Field Details
-
MODES
public static final int[][] MODES -
MODE_COUNT
public static final int MODE_COUNT- See Also:
-
GUESS_TYPES
public static final int GUESS_TYPES- See Also:
-
-
Constructor Details
-
RotatingCharsetDetector
public RotatingCharsetDetector()
-
-
Method Details
-
nextMode
public int nextMode(int curMode) -
getCharset
- Specified by:
getCharsetin classCharsetDetector- Returns:
- String charset name for the Resource
- Throws:
IOException- if there are problems reading the Resource
-