1
0
Fork 0
mirror of https://github.com/vanitasvitae/Smack.git synced 2025-12-12 14:01:08 +01:00

Create smack.util.stringencoder for Base64, Base32,…

Use Android's Base64 implementation when on Android, otherwise, when on
Java7, use the existing one.
This commit is contained in:
Florian Schmaus 2014-09-04 11:04:51 +02:00
parent 90c0064394
commit 5d4aa76d19
32 changed files with 491 additions and 231 deletions

View file

@ -38,6 +38,7 @@ import org.jivesoftware.smack.XMPPConnection;
import org.jivesoftware.smack.XMPPException.XMPPErrorException;
import org.jivesoftware.smack.packet.IQ;
import org.jivesoftware.smack.util.StringUtils;
import org.jivesoftware.smack.util.stringencoder.Base64;
import org.jivesoftware.smackx.vcardtemp.VCardManager;
/**
@ -372,7 +373,7 @@ public class VCard extends IQ {
}
// Otherwise, add to mappings.
String encodedImage = StringUtils.encodeBase64(bytes);
String encodedImage = Base64.encodeToString(bytes);
setAvatar(encodedImage, mimeType);
}
@ -425,7 +426,7 @@ public class VCard extends IQ {
if (photoBinval == null) {
return null;
}
return StringUtils.decodeBase64(photoBinval);
return Base64.decode(photoBinval);
}
/**