Here you can find the source of bytesToHexString(byte[] b)
Parameter | Description |
---|---|
b | a parameter |
public static final String bytesToHexString(byte[] b)
//package com.java2s; public class Main { /**/*from ww w . j ava 2 s . c o m*/ * * @param b * @return */ public static final String bytesToHexString(byte[] b) { StringBuffer sb = new StringBuffer(b.length); String str; for (int i = 0; i < b.length; i++) { str = Integer.toHexString(0xFF & b[i]); if (str.length() < 2) { sb.append(0); } sb.append(str.toUpperCase()); } return sb.toString(); } }