Here you can find the source of byteArr2HexStr(byte[] paramArrayOfByte)
public static String byteArr2HexStr(byte[] paramArrayOfByte) throws Exception
//package com.java2s; public class Main { public static String byteArr2HexStr(byte[] paramArrayOfByte) throws Exception { int i = paramArrayOfByte.length; StringBuffer localStringBuffer = new StringBuffer(i * 2); for (int j = 0; j < i; ++j) { for (int k = paramArrayOfByte[j]; k < 0; k += 256) { if (k < 16) localStringBuffer.append("0"); localStringBuffer.append(Integer.toString(k, 16)); }//from w w w.j a va 2 s .c om } return localStringBuffer.toString(); } }