Java Network Interface Get getInterfaces()

Here you can find the source of getInterfaces()

Description

get Interfaces

License

Apache License

Declaration

private static List<NetworkInterface> getInterfaces() throws SocketException 

Method Source Code

//package com.java2s;
//License from project: Apache License 

import java.net.NetworkInterface;
import java.net.SocketException;

import java.util.ArrayList;

import java.util.Enumeration;
import java.util.List;

public class Main {
    private static List<NetworkInterface> getInterfaces() throws SocketException {
        Enumeration<NetworkInterface> intfs = NetworkInterface.getNetworkInterfaces();

        List<NetworkInterface> intfsList = new ArrayList<NetworkInterface>();
        while (intfs.hasMoreElements()) {
            intfsList.add((NetworkInterface) intfs.nextElement());
        }/*from www  .jav  a2  s .  c om*/

        return intfsList;
    }
}

Related

  1. getInterfaceDiagnostic()
  2. getInterfaceInfo(NetworkInterface nif)
  3. getInterfaces()
  4. getInterfaces()
  5. getInterfaces()
  6. getInterfaces()
  7. getInterfaces(final String interfaceName)
  8. getKey()
  9. getLinkLocalScopeId()