Here you can find the source of toHex(byte b)
public static final String toHex(byte b)
//package com.java2s; //License from project: Open Source License public class Main { public static final String toHex(byte b) { return "" + "0123456789ABCDEF".charAt(0xf & b >> 4) + "0123456789ABCDEF".charAt(b & 0xf); }/*from w ww . j a v a 2 s.c o m*/ }