Here you can find the source of appendHex(StringBuffer sb, byte b)
private static void appendHex(StringBuffer sb, byte b)
//package com.java2s; public class Main { private final static String HEX = "0123456789ABCDEF"; private static void appendHex(StringBuffer sb, byte b) { sb.append(HEX.charAt((b >> 4) & 0x0f)).append(HEX.charAt(b & 0x0f)); }/* www.jav a 2 s . co m*/ }