public final class MacAddressUtil extends Object
Modifier and Type | Method and Description |
---|---|
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 String |
formatAddress(byte[] addr) |
static byte[] |
parseMAC(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(String value)
String
and return it as a byte[]
.value
- The string representation of the MAC address.public static String formatAddress(byte[] addr)
addr
- byte array of a MAC address.Copyright © 2008–2024 The Netty Project. All rights reserved.