Base64 decoder in android at API level 7

How to decode a base64 encoded string into a byte array at the Android 7 API level?

Can this be done using standard Java packages?

Should I copy the source code from Google search results?

Should I reuse the encoder and decoder in accordance with the RFC?

PS: Level 8 API uses the android.util.Base64 package that does this, but I need to do development based on API level 7.

+3
source share
3 answers

You can use this class,

org.bouncycastle.util.encoders.Base64

BouncyCastle is included in level 7.

-2
source

, n , , , - Mikael Grev MiGBase64, ( ) Android

v8 (android 2.2). . android.util.Base64

+11

Base64.NO_WRAP Android, Java

  • Java == > DatatypeConverter.printBase64Binary ( string2Encode.getBytes());
  • Android == > Base64.encodeToString( string2Encode.getBytes(), Base64.NO_WRAP);
0

Source: https://habr.com/ru/post/1751726/


All Articles