java,php,asp.net,linux,javascript,mysql,mssql,oracle,编程

将数组转成字符串 在调试或记录日志时用到

转载请注明:http://www.pmjava.com/Article/ShowInfo.asp?ID=56596
**
     * 将数组转成字符串 在调试或记录日志时用到
     *
     *
@param array
     *
@return
    
*/
   
public static String byte2string(byte[] array) {
        StringBuilder sb
= new StringBuilder();

        sb.append(
"Length " + array.length + " Content ");
       
       
for (int i = 0; i < leng; i++) {
            sb
= sb.append(String.format("%02X", array[i])).append(":");
        }
       
int ind = sb.lastIndexOf(":");
        sb.delete(ind, ind
+ 1);
       
return sb.toString();

posted on 2009-06-10 21:35 rrong_m 阅读(1742) 评论(0)  编辑  收藏


只有注册用户登录后才能发表评论。


网站导航:
 
<2024年5月>
2829301234
567891011
12131415161718
19202122232425
2627282930311
2345678

导航

统计

常用链接

随笔档案

文章分类

文章档案

java编程

搜索

积分与排名

最新评论

阅读排行榜

评论排行榜