Here you can find the source of macToBinary(String mac)
public static byte[] macToBinary(String mac)
//package com.java2s; //License from project: Apache License public class Main { public static byte[] macToBinary(String mac) { byte[] macBytes = new byte[6]; try {/*from ww w.ja v a2 s . c o m*/ String[] strArr = mac.split(":"); for (int i = 0; i < strArr.length; i++) { int value = Integer.parseInt(strArr[i], 16); macBytes[i] = (byte) value; } } catch (Exception e) { } return macBytes; } }