Here you can find the source of byteToHexWord(byte in)
public static final int byteToHexWord(byte in)
//package com.java2s; //License from project: Apache License public class Main { public static final int byteToHexWord(byte in) { byte[] table = { 0x30, 0x31, 0x32, 0x33, 0x34, 0x35, 0x36, 0x37, 0x38, 0x39, 0x41, 0x42, 0x43, 0x44, 0x45, 0x46 };//from w ww.j a va 2 s.c o m int result = 0x0000; result = (table[(in & 0xF0) >>> 4]) << 8; result = (result & 0xFF00) | (table[in & 0x0F]); return result; } }