public class NetworkUtil
extends java.lang.Object
| Constructor and Description |
|---|
NetworkUtil() |
| Modifier and Type | Method and Description |
|---|---|
static java.util.Collection<java.net.NetworkInterface> |
filterBySubnet(java.net.InetAddress address,
int subnetPrefix)
Search for a list of network interfaces that match the specified address and subnet prefix.
|
static java.net.InetAddress |
findAddressOnInterface(java.net.NetworkInterface ifc,
java.net.InetAddress address,
int subnetPrefix) |
static java.net.ProtocolFamily |
getProtocolFamily(java.net.InetAddress address) |
public static java.util.Collection<java.net.NetworkInterface> filterBySubnet(java.net.InetAddress address,
int subnetPrefix)
throws java.net.SocketException
InterfaceAddress.getNetworkPrefixLength()). If no results match, then the collection
will be empty.address - to search for on the NetworkInterfaces.subnetPrefix - to limit the search.NetworkInterfaces that match the supplied criteria, ordered by the length
of the subnet prefix. Empty if none match.java.net.SocketException - if an error occurspublic static java.net.InetAddress findAddressOnInterface(java.net.NetworkInterface ifc,
java.net.InetAddress address,
int subnetPrefix)
public static java.net.ProtocolFamily getProtocolFamily(java.net.InetAddress address)
Copyright © 2014 - 2016 Real Logic Ltd. All Rights Reserved.