Here you can find the source of byteToHex(byte bytevalue)
public static String byteToHex(byte bytevalue)
//package com.java2s; //License from project: LGPL public class Main { public static String byteToHex(byte bytevalue) { final char[] hexArray = { '0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'A', 'B', 'C', 'D', 'E', 'F' }; int v = bytevalue & 0xFF; return new String(new char[] { hexArray[v >>> 4], hexArray[v & 0x0F] }); }/*www . j ava2s . c om*/ }