Java tutorial
//package com.java2s; public class Main { public static String makeDeviceID(byte[] bytes) { if (bytes.length < 12) return ""; StringBuffer sb = new StringBuffer(); for (byte b : bytes) { sb.append(Integer.toHexString((b & 0xFF) | 0xFFFFFF00).substring(6).toUpperCase()); } return sb.toString(); } }