Here you can find the source of byteToString(byte b)
public static String byteToString(byte b)
//package com.java2s; public class Main { public static String byteToString(byte b) { String result = String.valueOf(Integer.toHexString(b & 0xFF)); if (result.length() == 1) result = "0" + result; return result.toUpperCase(); }/*w w w . j ava 2 s . co m*/ }