public class EthernetAddress extends Object implements Serializable, Cloneable
Constructor and Description |
---|
EthernetAddress(byte[] ethernetAddress)
Create a EthernetAddress based on the provided bytes.
|
EthernetAddress(String ethernetAddress)
Create a EthernetAddress based on the provided address.
|
Modifier and Type | Method and Description |
---|---|
protected String |
byteToHexString(byte b) |
Object |
clone() |
boolean |
equals(Object obj) |
int |
hashCode() |
protected byte[] |
parseEthernetAddress(String ethernetAddress)
Parses a String representing an ethernet address into an byte array.
|
byte[] |
toBytes()
Returns the byte representation of this ethernet address.
|
String |
toString() |
public EthernetAddress(String ethernetAddress) throws IllegalEthernetAddressException
ethernetAddress
- the ethernet addressIllegalArgumentException
- if the ethernet address could not be parsedNullPointerException
- if the ethernet address is nullIllegalEthernetAddressException
public EthernetAddress(byte[] ethernetAddress) throws IllegalEthernetAddressException
ethernetAddress
- the bytes. Must have length of 6!IllegalEthernetAddressException
- if ethernet address is of illegal length or nullNullPointerException
- if the ethernet address is nullprotected byte[] parseEthernetAddress(String ethernetAddress) throws IllegalEthernetAddressException
ethernetAddress
- a String representation of the ethernet address.IllegalEthernetAddressException
public byte[] toBytes()
protected String byteToHexString(byte b)