Here you can find the source of getMacBytes()
public static byte[] getMacBytes()
//package com.java2s; //License from project: Apache License import java.net.InetAddress; import java.net.NetworkInterface; public class Main { public static byte[] getMacBytes() { try {/* w w w .ja v a2 s . co m*/ InetAddress ia = InetAddress.getLocalHost(); return NetworkInterface.getByInetAddress(ia).getHardwareAddress(); } catch (Exception e) { return null; } } }