1
0
Fork 0
mirror of https://codeberg.org/Mercury-IM/Smack synced 2025-09-09 10:19:41 +02:00

Use java.util.Base64 and remove build-in Base64 API

This commit is contained in:
Florian Schmaus 2019-04-08 23:03:12 +02:00
parent 0d17f195b0
commit 7d5274dad1
7 changed files with 57 additions and 1802 deletions

View file

@ -1,6 +1,6 @@
/**
*
* Copyright © 2014 Florian Schmaus
* Copyright © 2014-2019 Florian Schmaus
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@ -42,18 +42,12 @@ public final class AndroidBase64Encoder implements org.jivesoftware.smack.util.s
}
@Override
public byte[] decode(byte[] input, int offset, int len) {
return Base64.decode(input, offset, len, 0);
public String encodeToString(byte[] input) {
return Base64.encodeToString(input, BASE64_ENCODER_FLAGS);
}
@Override
public String encodeToString(byte[] input, int offset, int len) {
return Base64.encodeToString(input, offset, len, BASE64_ENCODER_FLAGS);
public byte[] encode(byte[] input) {
return Base64.encode(input, BASE64_ENCODER_FLAGS);
}
@Override
public byte[] encode(byte[] input, int offset, int len) {
return Base64.encode(input, offset, len, BASE64_ENCODER_FLAGS);
}
}