Java tutorial
//package com.java2s; public class Main { public static String byteToHexString(byte b) { return Integer.toHexString(byte2Int(b)); } public static int byte2Int(byte b) { return b & 0xff; } }