标签:
在java API中String有一个方法
public byte[] getBytes()
Encodes this String into a sequence of bytes using the platform‘s default charset, storing the result into a new byte array.
The behavior of this method when this string cannot be encoded in the default charset is unspecified. The CharsetEncoder class should be used when more control over the encoding process is required.
对这个字符串进行编码为一个字节序列使用平台的默认字符集,结果存储到一个新的字节数组
Returns:
The resultant byte array
整个晚上和客户一直抓包,发现有个字符串的长度不一样,在调用接口的时候,不匹配
解决方案
慎用该方法
http://www.blogjava.net/baizhihui19870626/articles/388054.html
标签:
原文地址:http://www.cnblogs.com/sun-rain/p/4868726.html