Jitsi: the OpenSource Java VoIP and Instant Messaging client.

net.java.sip.communicator.impl.netaddr
Class HardwareAddressRetriever

java.lang.Object
  extended by net.java.sip.communicator.impl.netaddr.HardwareAddressRetriever

public class HardwareAddressRetriever
extends Object

Class to retrieve hardware address of a specific interface. We know that starting Java 6, NetworkInterface has getHardwareAddress method but as we still support Java 5 we have to do it ourself.

Author:
Sebastien Vincent

Constructor Summary
HardwareAddressRetriever()
           
 
Method Summary
static byte[] getHardwareAddress(String ifName)
          Returns the hardware address of a particular interface.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

HardwareAddressRetriever

public HardwareAddressRetriever()
Method Detail

getHardwareAddress

public static byte[] getHardwareAddress(String ifName)
Returns the hardware address of a particular interface.

Parameters:
ifName - name of the interface
Returns:
byte array representing the hardware address of the interface or null if interface is not found or other system related errors

Jitsi: the OpenSource Java VoIP and Instant Messaging client.

Jitsi, the OpenSource Java VoIP and Instant Messaging client.
Distributable under LGPL license.