public class InetAddressUtil extends Object
| Modifier and Type | Method and Description |
|---|---|
static int |
checkNetmask(InetAddress netmask)
Deprecated.
This was an internal implementation detail of the method
contains(java.net.InetAddress, java.net.InetAddress, java.net.InetAddress) and should never have been made public.
Furthermore it's broken for IPv6. (However, there is no real
replacement. If you need this functionality, you should
rewrite it yourself.) |
static boolean |
contains(InetAddress network,
InetAddress netmask,
InetAddress ip)
Checks if a subnet contains a specific IP address.
|
static InetAddress |
getAddress(String string)
Deprecated.
This was an internal implementation detail of the method
contains(java.net.InetAddress, java.net.InetAddress, java.net.InetAddress) and should never have been made public.
(And it's unnecessary too, as well as broken for IPv6. ;-)
Use InetAddress.getByName(string) instead. |
static int |
getClassPart(InetAddress ip,
int partNumber)
Deprecated.
This was an internal implementation detail of the method
contains(java.net.InetAddress, java.net.InetAddress, java.net.InetAddress) and should never have been made public.
(And it's inefficient and unnecessary too, as well as broken
for IPv6. ;-) Use ip.getAddress()[partNumber]
instead. |
public static boolean contains(InetAddress network, InetAddress netmask, InetAddress ip)
network - The network address.netmask - The subnet mask.ip - The IP address to check.true if the masked network and ip addresses match,
false otherwise@Deprecated public static int getClassPart(InetAddress ip, int partNumber)
contains(java.net.InetAddress, java.net.InetAddress, java.net.InetAddress) and should never have been made public.
(And it's inefficient and unnecessary too, as well as broken
for IPv6. ;-) Use ip.getAddress()[partNumber]
instead.ip - The address.partNumber - The number of the part.@Deprecated public static int checkNetmask(InetAddress netmask)
contains(java.net.InetAddress, java.net.InetAddress, java.net.InetAddress) and should never have been made public.
Furthermore it's broken for IPv6. (However, there is no real
replacement. If you need this functionality, you should
rewrite it yourself.)netmask - The netmask address.@Deprecated public static InetAddress getAddress(String string) throws UnknownHostException
contains(java.net.InetAddress, java.net.InetAddress, java.net.InetAddress) and should never have been made public.
(And it's unnecessary too, as well as broken for IPv6. ;-)
Use InetAddress.getByName(string) instead.string - The IP address, represented by a string.UnknownHostExceptionCopyright © 2009-2013. All Rights Reserved.