Here you can find the source of toHexString(byte[] paramArrayOfByte, String paramString, boolean paramBoolean)
public static String toHexString(byte[] paramArrayOfByte, String paramString, boolean paramBoolean)
//package com.java2s; public class Main { public static String toHexString(byte[] paramArrayOfByte, String paramString, boolean paramBoolean) { StringBuilder localStringBuilder = new StringBuilder(); int i = paramArrayOfByte.length; for (int j = 0; j < i; j++) { String str = Integer.toHexString(0xFF & paramArrayOfByte[j]); if (paramBoolean) str = str.toUpperCase(); if (str.length() == 1) localStringBuilder.append("0"); localStringBuilder.append(str).append(paramString); }/*from www .j ava 2 s.c o m*/ return localStringBuilder.toString(); } }