I have coded the following code to encode the byte[] str.
Byte[] str;
Byte[] encoded=Base64.encodeToString(str);
But Base64 word is not defined
I tried base64.encode() & base64.getEncoder()
I found a defined statement But I don't know how to use it:
byte[] encoded=Base64.encoder()
How to use it? Or how can I encode a string or byte[] with or without libraries.
Byte[]andbyte[]aren't the same types. You almost certainly wantbyte[]. Next, to use theBase64class in Android, you should importandroid.util.Base64.Base64.encoder()? docs.oracle.com/javase/8/docs/api/java/util/Base64.Encoder.html