|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.openexchange.mail.utils.CharsetDetector
public final class CharsetDetector
CharsetDetector - A charset detector based on jchardet library.
| Method Summary | |
|---|---|
static boolean |
checkName(java.lang.String s)
Checks that the given string is a legal charset name. |
static java.lang.String |
detectCharset(java.io.ByteArrayInputStream in)
Detects the charset of specified byte array input stream's data. |
static java.lang.String |
detectCharset(java.io.InputStream in)
Detects the charset of specified input stream's data. |
static java.lang.String |
detectPartCharset(javax.mail.Part p)
Detects the charset of specified part. |
static boolean |
isValid(java.lang.String charset)
Convenience method to check if given name is valid; meaning not null, a legal charset name and supported as indicated by
Charset.isSupported(String). |
| Methods inherited from class java.lang.Object |
|---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Method Detail |
|---|
public static boolean isValid(java.lang.String charset)
null, a legal charset name and supported as indicated by
Charset.isSupported(String).
charset - The charset name whose validity shall be checked
true if given name is valid; otherwise falsepublic static boolean checkName(java.lang.String s)
s - The charset name
true if the given name is a legal charset name; otherwise false
java.lang.NullPointerException - If given name is null
public static java.lang.String detectPartCharset(javax.mail.Part p)
throws javax.mail.MessagingException
p - The part whose charset shall be detected
javax.mail.MessagingException - If an error occurs in part's getter methodspublic static java.lang.String detectCharset(java.io.ByteArrayInputStream in)
Note: Specified input stream is going to be closed in this method.
in - The byte array input stream to examine
java.lang.NullPointerException - If input stream is nullpublic static java.lang.String detectCharset(java.io.InputStream in)
Note: Specified input stream is going to be closed in this method.
in - The input stream to examine
java.lang.NullPointerException - If input stream is null
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||