Java Network Interface Get getAllAvailableInterfaces()

Here you can find the source of getAllAvailableInterfaces()

Description

get All Available Interfaces

License

LGPL

Declaration

public static List<NetworkInterface> getAllAvailableInterfaces() throws SocketException 

Method Source Code

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

import java.net.*;

import java.util.*;

public class Main {
    public static List<NetworkInterface> getAllAvailableInterfaces() throws SocketException {
        List<NetworkInterface> retval = new ArrayList<NetworkInterface>(10);
        NetworkInterface intf;/*from ww w .  j  a va 2  s  .  c  om*/
        for (Enumeration en = NetworkInterface.getNetworkInterfaces(); en.hasMoreElements();) {
            intf = (NetworkInterface) en.nextElement();
            retval.add(intf);
        }
        return retval;
    }
}

Related

  1. enumerateInterfaces()
  2. getAllAvailableInterfaces()
  3. getAllAvailableInterfaces()
  4. getAllInterfaces()
  5. getAllInterfaces()
  6. getAllLocalInterfaces()