Here you can find the source of appendHex(StringBuffer sb, byte b)
Parameter | Description |
---|---|
sb | the string to be appended new character. |
b | the byte data |
private static void appendHex(StringBuffer sb, byte b)
//package com.java2s; public class Main { /**//from www . j a v a2 s .c om * Padding HEX string. */ public static final String HEX = "0123456789ABCDEF"; /** * utility function to transfer the byte data. * @param sb the string to be appended new character. * @param b the byte data */ private static void appendHex(StringBuffer sb, byte b) { sb.append(HEX.charAt((b >> 4) & 0x0f)).append(HEX.charAt(b & 0x0f)); } }