Here you can find the source of bytesToHexString(byte[] bArray)
Parameter | Description |
---|---|
bArray | a parameter |
public static final String bytesToHexString(byte[] bArray)
//package com.java2s; //License from project: Open Source License public class Main { /**/*www . j av a2 s . c o m*/ * @param bArray * @return HexString */ public static final String bytesToHexString(byte[] bArray) { StringBuffer sb = new StringBuffer(bArray.length); String sTemp; for (int i = 0; i < bArray.length; i++) { sTemp = Integer.toHexString(0xFF & bArray[i]); if (sTemp.length() < 2) sb.append(0); sb.append(sTemp); } return sb.toString(); } }