Java: Different results when decoding base64 string with java.util.Base64 vs android.util.Base64 Java: Different results when decoding base64 string with java.util.Base64 vs android.util.Base64 android android

Java: Different results when decoding base64 string with java.util.Base64 vs android.util.Base64


On android, Use Base64.NO_WRAP instead of Base64.DEFAULT

@Overrideprotected String encode(byte[] bytes) {    return Base64.encodeToString(bytes, Base64.NO_WRAP);}


Instead of Base64.getDecoder() use Base64.getMimeDecoder().