Class MACAddress


public class MACAddress
extends java.lang.Object

MAC address.

This class doesn't yet store MAC addresses. Only a utility method to extract a MAC address from a big-endian byte array is implemented.

Field Summary
static int WIDTH
          The width in bytes of a MAC address.
Constructor Summary
Method Summary
static java.lang.String extract(int offset, byte[] bytes)
          Extract a MAC address from an array of bytes.
static long random()
          Generate a random MAC address.
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Field Detail


public static final int WIDTH
The width in bytes of a MAC address.

See Also:
Constant Field Values
Constructor Detail


public MACAddress()
Method Detail


public static java.lang.String extract(int offset,
                                       byte[] bytes)
Extract a MAC address from an array of bytes.

offset - the offset of the address data from the start of the packet.
bytes - an array of bytes containing at least one MAC address.


public static long random()
Generate a random MAC address.