Here you can find the source of byteToHexStringSingle(byte[] byteArray)
public static String byteToHexStringSingle(byte[] byteArray)
//package com.java2s; //License from project: Apache License public class Main { public static String byteToHexStringSingle(byte[] byteArray) { StringBuffer md5StrBuff = new StringBuffer(); for (int i = 0; i < byteArray.length; i++) { if (Integer.toHexString(0xFF & byteArray[i]).length() == 1) { md5StrBuff.append("0").append(Integer.toHexString(0xFF & byteArray[i])); } else { md5StrBuff.append(Integer.toHexString(0xFF & byteArray[i])); }/*from w w w . j a va 2s . com*/ } return md5StrBuff.toString(); } }