public final class MacAddressUtil
extends java.lang.Object
限定符和类型 | 方法和说明 |
---|---|
static byte[] |
bestAvailableMac()
Obtains the best MAC address found on local network interfaces.
|
static byte[] |
defaultMachineId()
Returns the result of
bestAvailableMac() if non-null otherwise returns a random EUI-64 MAC
address. |
static java.lang.String |
formatAddress(byte[] addr) |
static byte[] |
parseMAC(java.lang.String value)
Parse a EUI-48, MAC-48, or EUI-64 MAC address from a
String and return it as a byte[] . |
public static byte[] bestAvailableMac()
public static byte[] defaultMachineId()
bestAvailableMac()
if non-null
otherwise returns a random EUI-64 MAC
address.public static byte[] parseMAC(java.lang.String value)
String
and return it as a byte[]
.value
- The string representation of the MAC address.public static java.lang.String formatAddress(byte[] addr)
addr
- byte array of a MAC address.