📜  如何使用 base64.getdecoder() android - Java 代码示例

📅  最后修改于: 2022-03-11 14:52:28.843000             🧑  作者: Mango

代码示例1
import android.util.Base64;

...

String testValue = "Hello, world!";

byte[] encodeValue = Base64.encode(testValue.getBytes(), Base64.DEFAULT);
byte[] decodeValue = Base64.decode(encodeValue, Base64.DEFAULT);

Log.d("ENCODE_DECODE", "defaultValue = " + testValue);
Log.d("ENCODE_DECODE", "encodeValue = " + new String(encodeValue));
Log.d("ENCODE_DECODE", "decodeValue = " + new String(decodeValue));