Here you can find the source of toHexByte(byte b)
public static String toHexByte(byte b)
//package com.java2s; //License from project: Open Source License public class Main { public static String toHexByte(byte b) { return String.format("0x%02X", b & 0xFF); }/*from ww w . j a va2s. c o m*/ public static String toHexByte(int b) { return String.format("0x%02X", b); } }