本文整理匯總了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;
}
示例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);
}
}
示例3: getAvatarBinary
import org.jivesoftware.smack.util.StringUtils; //導入方法依賴的package包/類
public static byte[] getAvatarBinary() {
return StringUtils.decodeBase64(getAvatarEncoded());
}
示例4: getIncomingSoundBytes
import org.jivesoftware.smack.util.StringUtils; //導入方法依賴的package包/類
public byte[] getIncomingSoundBytes() {
return StringUtils.decodeBase64(incomingSound);
}
示例5: getOutgoingSoundBytes
import org.jivesoftware.smack.util.StringUtils; //導入方法依賴的package包/類
public byte[] getOutgoingSoundBytes() {
return StringUtils.decodeBase64(outgoingSound);
}
示例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);
}
示例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);
}