Here you can find the source of byteToHexString(byte b)
public static String byteToHexString(byte b)
//package com.java2s; //License from project: Open Source License public class Main { public static String byteToHexString(byte b) { StringBuilder sb = new StringBuilder(); sb.append(String.format("%02x", b & 0xff)); return sb.toString(); }//from w w w .j a va 2 s. c om }