一直都默认的认为
(byte[] data) 可行的,其实还是含有隐患,今天查了一下接口发现:
(byte[] data)
Converts the byte array to a string using the system's
. 是采用默认的charset
This is determined during VM startup, and will not change thereafter. On Android, the default charset is UTF-8.
所以隐患是如果移植到其他系统,可能会有问题,应该指定一个charset
(byte[] data, charsetName)
Converts the byte array to a string using the named charset.