Here you can find the source of bytesToMac(byte[] bytes)
public static String bytesToMac(byte[] bytes)
//package com.java2s; //License from project: Apache License public class Main { public static String bytesToMac(byte[] bytes) { StringBuffer sb = new StringBuffer(); for (int i = 0; i < bytes.length; i++) { String s = Integer.toHexString(0xFF & bytes[i]).toUpperCase(); if (i > 0) { sb.append(":"); }//from ww w .j a v a 2 s. com if (s.length() == 1) { sb.append("0"); } sb.append(s); } return sb.toString(); } }