标签:数据转换 integer pre 转换 code for ring param hex
1 /** 2 3 * Hex格式数据转换成十六进制字符串 4 5 * @param src 6 7 */ 8 9 public void bytesToHexString(byte[] by){ 10 StringBuilder stringBuilder = new StringBuilder(""); 11 for (int i = 0; i < by.length; i++) { 12 int in = by[i] & 0xFF; 13 String str= Integer.toHexString(in); 14 if (str.length() < 2) { 15 stringBuilder.append(0); 16 } 17 stringBuilder.append(str); 18 } 19 System.out.println(stringBuilder.toString()); 20 }
标签:数据转换 integer pre 转换 code for ring param hex
原文地址:http://www.cnblogs.com/cnndevelop/p/6034401.html