Java tutorial
//package com.java2s; import java.util.Locale; public class Main { public static String getMinor(final byte[] scanRecord) { return intToHex2(scanRecord[27] & 0xff) + intToHex2(scanRecord[28] & 0xff); } private static String intToHex2(final int i) { final char hex_2[] = { Character.forDigit((i >> 4) & 0x0f, 16), Character.forDigit(i & 0x0f, 16) }; return new String(hex_2).toUpperCase(Locale.ENGLISH); } }