當前位置: 首頁>>代碼示例>>Java>>正文


Java StringUtils.UTF8屬性代碼示例

本文整理匯總了Java中org.jivesoftware.smack.util.StringUtils.UTF8屬性的典型用法代碼示例。如果您正苦於以下問題:Java StringUtils.UTF8屬性的具體用法?Java StringUtils.UTF8怎麽用?Java StringUtils.UTF8使用的例子?那麽, 這裏精選的屬性代碼示例或許可以為您提供幫助。您也可以進一步了解該屬性所在org.jivesoftware.smack.util.StringUtils的用法示例。


在下文中一共展示了StringUtils.UTF8屬性的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: decodeToString

public static final String decodeToString(String string) {
    byte[] bytes = decode(string);
    try {
        return new String(bytes, StringUtils.UTF8);
    } catch (UnsupportedEncodingException e) {
        throw new IllegalStateException("UTF-8 not supported", e);
    }
}
 
開發者ID:TTalkIM,項目名稱:Smack,代碼行數:8,代碼來源:Base64.java

示例2: decode

@Override
public String decode(String string) {
    byte[] bytes = Base64.decode(string, BASE64_ENCODER_FLAGS);
    try {
        return new String(bytes, StringUtils.UTF8);
    } catch (UnsupportedEncodingException e) {
        throw new IllegalStateException("UTF-8 not supported", e);
    }
}
 
開發者ID:TTalkIM,項目名稱:Smack,代碼行數:9,代碼來源:AndroidBase64UrlSafeEncoder.java

示例3: isTrustedOmemoIdentity

@Override
public boolean isTrustedOmemoIdentity(OmemoManager omemoManager, OmemoDevice device, OmemoFingerprint fingerprint) {
    File trustPath = hierarchy.getContactsTrustPath(omemoManager, device);
    try {
        String depositedFingerprint = new String(readBytes(trustPath), StringUtils.UTF8);

        return  depositedFingerprint.length() > 2
                && depositedFingerprint.charAt(0) == '1'
                && new OmemoFingerprint(depositedFingerprint.substring(2)).equals(fingerprint);
    } catch (IOException e) {
        return false;
    }
}
 
開發者ID:zom,項目名稱:Zom-Android,代碼行數:13,代碼來源:IOCipherOmemoStore.java

示例4: isDecidedOmemoIdentity

@Override
public boolean isDecidedOmemoIdentity(OmemoManager omemoManager, OmemoDevice device, OmemoFingerprint fingerprint) {
    File trustPath = hierarchy.getContactsTrustPath(omemoManager, device);
    try {
        String depositedFingerprint = new String(readBytes(trustPath), StringUtils.UTF8);

        return  depositedFingerprint.length() > 2
                && (depositedFingerprint.charAt(0) == '1' || depositedFingerprint.charAt(0) == '2')
                && new OmemoFingerprint(depositedFingerprint.substring(2)).equals(fingerprint);
    } catch (IOException e) {
        return false;
    }
}
 
開發者ID:zom,項目名稱:Zom-Android,代碼行數:13,代碼來源:IOCipherOmemoStore.java


注:本文中的org.jivesoftware.smack.util.StringUtils.UTF8屬性示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。