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


Java StringUtils.decodeBase64方法代碼示例

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


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

示例1: getDecodedData

import org.jivesoftware.smack.util.StringUtils; //導入方法依賴的package包/類
/**
 * Returns the decoded data or null if data could not be decoded.
 * <p>
 * The encoded data is invalid if it contains bad Base64 input characters or
 * if it contains the pad ('=') character on a position other than the last
 * character(s) of the data. See <a
 * href="http://xmpp.org/extensions/xep-0047.html#sec">XEP-0047</a> Section
 * 6.
 * 
 * @return the decoded data
 */
public byte[] getDecodedData() {
    // return cached decoded data
    if (this.decodedData != null) {
        return this.decodedData;
    }

    // data must not contain the pad (=) other than end of data
    if (data.matches(".*={1,2}+.+")) {
        return null;
    }

    // decodeBase64 will return null if bad characters are included
    this.decodedData = StringUtils.decodeBase64(data);
    return this.decodedData;
}
 
開發者ID:ice-coffee,項目名稱:EIM,代碼行數:27,代碼來源:DataPacketExtension.java

示例2: decodeSubgraph

import org.jivesoftware.smack.util.StringUtils; //導入方法依賴的package包/類
public static RAMStorageGraph decodeSubgraph(String sgraphString)
{
	try
	{
		ByteArrayInputStream in = new ByteArrayInputStream(StringUtils.decodeBase64(sgraphString));
		return (RAMStorageGraph)new SubgraphSerializer().readData(in);
	}
	catch (IOException e)
	{
		throw new RuntimeException(e);
	}
}
 
開發者ID:hypergraphdb,項目名稱:hypergraphdb,代碼行數:13,代碼來源:SubgraphManager.java

示例3: getAvatarBinary

import org.jivesoftware.smack.util.StringUtils; //導入方法依賴的package包/類
public static byte[] getAvatarBinary() {
    return StringUtils.decodeBase64(getAvatarEncoded());
}
 
開發者ID:TTalkIM,項目名稱:Smack,代碼行數:4,代碼來源:VCardTest.java

示例4: getIncomingSoundBytes

import org.jivesoftware.smack.util.StringUtils; //導入方法依賴的package包/類
public byte[] getIncomingSoundBytes() {
    return StringUtils.decodeBase64(incomingSound);
}
 
開發者ID:ice-coffee,項目名稱:EIM,代碼行數:4,代碼來源:SoundSettings.java

示例5: getOutgoingSoundBytes

import org.jivesoftware.smack.util.StringUtils; //導入方法依賴的package包/類
public byte[] getOutgoingSoundBytes() {
    return StringUtils.decodeBase64(outgoingSound);
}
 
開發者ID:ice-coffee,項目名稱:EIM,代碼行數:4,代碼來源:SoundSettings.java

示例6: getAvatar

import org.jivesoftware.smack.util.StringUtils; //導入方法依賴的package包/類
/**
 * Return the byte representation of the avatar(if one exists), otherwise returns null if
 * no avatar could be found.
 * <b>Example 1</b>
 * <pre>
 * // Load Avatar from VCard
 * byte[] avatarBytes = vCard.getAvatar();
 * <p/>
 * // To create an ImageIcon for Swing applications
 * ImageIcon icon = new ImageIcon(avatar);
 * <p/>
 * // To create just an image object from the bytes
 * ByteArrayInputStream bais = new ByteArrayInputStream(avatar);
 * try {
 *   Image image = ImageIO.read(bais);
 *  }
 *  catch (IOException e) {
 *    e.printStackTrace();
 * }
 * </pre>
 *
 * @return byte representation of avatar.
 */
public byte[] getAvatar() {
    if (avatar == null) {
        return null;
    }
    return StringUtils.decodeBase64(avatar);
}
 
開發者ID:ice-coffee,項目名稱:EIM,代碼行數:30,代碼來源:VCard.java

示例7: getAvatar

import org.jivesoftware.smack.util.StringUtils; //導入方法依賴的package包/類
/**
 * Return the byte representation of the avatar(if one exists), otherwise returns null if
 * no avatar could be found.
 * <b>Example 1</b>
 * <pre>
 * // Load Avatar from VCard
 * byte[] avatarBytes = vCard.getAvatar();
 * <p/>
 * // To create an ImageIcon for Swing applications
 * ImageIcon icon = new ImageIcon(avatar);
 * <p/>
 * // To create just an image object from the bytes
 * ByteArrayInputStream bais = new ByteArrayInputStream(avatar);
 * try {
 *   Image image = ImageIO.read(bais);
 *  }
 *  catch (IOException e) {
 *    e.printStackTrace();
 * }
 * </pre>
 *
 * @return byte representation of avatar.
 */
public byte[] getAvatar() {
    if (photoBinval == null) {
        return null;
    }
    return StringUtils.decodeBase64(photoBinval);
}
 
開發者ID:CJC-ivotten,項目名稱:androidPN-client.,代碼行數:30,代碼來源:VCard.java


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