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)); }/*from w w w .j a v a2 s.co m*/ }