Main.java Source code

Java tutorial

Introduction

Here is the source code for Main.java

Source

//package com.java2s;

public class Main {
    /**
     * Get the mac address bytes format by the device's bssid String format
     * @param bssid the device's bssid String format
     * @return the mac address bytes format
     */
    public static byte[] getMacAddressBytes(String bssid) {
        String[] bssidStrSplit = bssid.split(":");
        byte[] bssidBytes = new byte[bssidStrSplit.length];
        for (int i = 0; i < bssidStrSplit.length; ++i) {
            String bssidStr = bssidStrSplit[i];
            bssidBytes[i] = (byte) Integer.parseInt(bssidStr, 16);
        }
        return bssidBytes;
    }
}