Class EthernetAddress

  • All Implemented Interfaces:
    Serializable, Cloneable

    public class EthernetAddress
    extends Object
    implements Serializable, Cloneable
    This class represents a ethernet address.

    An Ethernet Address ia a six octets (48 bits) number that uniquelly identifies every network interface card (NIC). The first three octects (24 bits) are known as the Organizationally Unique Identifier (OUI) and identifies its manufacturer.
    Author:
    Steffen Moldaner
    See Also:
    Serialized Form
    • Method Detail

      • parseEthernetAddress

        protected byte[] parseEthernetAddress​(String ethernetAddress)
                                       throws IllegalEthernetAddressException
        Parses a String representing an ethernet address into an byte array. The String must be a list of 6 hexadecimal bytes, sepeartet by a colon.

        Example: 00:50:95:10:95:F5
        Parameters:
        ethernetAddress - a String representation of the ethernet address.
        Returns:
        a byte array containing the byte representation of the ethernet address
        Throws:
        IllegalEthernetAddressException
      • toBytes

        public byte[] toBytes()
        Returns the byte representation of this ethernet address.
        Returns:
        the bytes
      • byteToHexString

        protected String byteToHexString​(byte b)
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class Object