mirror of
https://github.com/VibedByKaKi/alexandroid.git
synced 2026-11-15 02:17:18 +01:00
35 lines
1 KiB
Java
35 lines
1 KiB
Java
package com.amazonaws.util;
|
|
|
|
/* compiled from: r8-map-id-b9432e0f623b4a4bff4ba50a8a24c4aafad2c1e11092747b9fb5e6a22af5a940 */
|
|
/* loaded from: classes6.dex */
|
|
public enum Base64 {
|
|
;
|
|
|
|
private static final Base64Codec CODEC = new Base64Codec();
|
|
|
|
public static byte[] decode(String str) {
|
|
if (str == null) {
|
|
return null;
|
|
}
|
|
if (str.length() == 0) {
|
|
return new byte[0];
|
|
}
|
|
byte[] bArr = new byte[str.length()];
|
|
return CODEC.decode(bArr, CodecUtils.sanitize(str, bArr));
|
|
}
|
|
|
|
public static byte[] encode(byte[] bArr) {
|
|
return (bArr == null || bArr.length == 0) ? bArr : CODEC.encode(bArr);
|
|
}
|
|
|
|
public static String encodeAsString(byte... bArr) {
|
|
if (bArr == null) {
|
|
return null;
|
|
}
|
|
return bArr.length == 0 ? "" : CodecUtils.toStringDirect(CODEC.encode(bArr));
|
|
}
|
|
|
|
public static byte[] decode(byte[] bArr) {
|
|
return (bArr == null || bArr.length == 0) ? bArr : CODEC.decode(bArr, bArr.length);
|
|
}
|
|
}
|