Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我们不能将字符串对象转换为字节对象吗?
public bitmap a(String s){ byte[] b=(byte[])getValue(s); ... }
getValue返回一个字符串对象。
getValue
使用String.getBytes()及其重载版本将 a 转换String为byte[].
String.getBytes()
String
byte[]
有一些重载版本允许您指定 UTF-8 之类的字符集,例如:
getBytes(String charsetName);