java获取一个字符串字节长度
String a = "ddddddd";
Byte[] buf = a.getBytes();
System.out.println(buf.length+"Byte="+buf.length/1024+"KB" );
声明:该文观点仅代表作者本人,牛骨文系教育信息发布平台,牛骨文仅提供信息存储空间服务。
- 上一篇: 详解:502 Bad Gateway nginx/xxx
- 下一篇: 用java截取字符串长度的方法
String a = "ddddddd";
Byte[] buf = a.getBytes();
System.out.println(buf.length+"Byte="+buf.length/1024+"KB" );