[英]String to byte[] decoding error: no suitable method found for decode(byte[])
我将Bitmap解码为String并将ut放在SharedPreferences中 。
然后我把它放进PhotoEncoded
在这里,我想将其解码为byte [],但它显示了一个错误:
String PhotoEncoded = prefs.getString("AccountPhotoString",null);
byte[] b = PhotoEncoded.getBytes();
byte[] imageAsBytes = Base64.decode(b);//error
怎么了
我找到了解决方案
PhotoEncoded = prefs.getString("AccountPhoto",null);
byte[] b = PhotoEncoded.getBytes();
byte[] imageAsBytes = Base64.decode(b,Base64.DEFAULT);
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.