|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.xbill.DNS.Address
public final class Address
Routines dealing with IP addresses. Includes functions similar to those in the java.net.InetAddress class.
Field Summary | |
---|---|
static int |
IPv4
|
static int |
IPv6
|
Method Summary | |
---|---|
static int |
addressLength(int family)
Returns the length of an address in a particular family. |
static int |
familyOf(InetAddress address)
Returns the family of an InetAddress. |
static InetAddress[] |
getAllByName(String name)
Determines all IP address of a host |
static InetAddress |
getByAddress(String addr)
Converts an address from its string representation to an IP address. |
static InetAddress |
getByAddress(String addr,
int family)
Converts an address from its string representation to an IP address in a particular family. |
static InetAddress |
getByName(String name)
Determines the IP address of a host |
static String |
getHostName(InetAddress addr)
Determines the hostname for an address |
static boolean |
isDottedQuad(String s)
Determines if a string contains a valid IP address. |
static int[] |
toArray(String s)
Convert a string containing an IPv4 address to an array of 4 integers. |
static int[] |
toArray(String s,
int family)
Convert a string containing an IP address to an array of 4 or 16 integers. |
static byte[] |
toByteArray(String s,
int family)
Convert a string containing an IP address to an array of 4 or 16 bytes. |
static String |
toDottedQuad(byte[] addr)
Converts a byte array containing an IPv4 address into a dotted quad string. |
static String |
toDottedQuad(int[] addr)
Converts an int array containing an IPv4 address into a dotted quad string. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final int IPv4
public static final int IPv6
Method Detail |
---|
public static int[] toArray(String s, int family)
s
- The address, in text format.family
- The address family.
public static int[] toArray(String s)
s
- The address, in text format.
public static byte[] toByteArray(String s, int family)
s
- The address, in text format.family
- The address family.
public static boolean isDottedQuad(String s)
s
- The string
public static String toDottedQuad(byte[] addr)
addr
- The array
public static String toDottedQuad(int[] addr)
addr
- The array
public static InetAddress getByName(String name) throws UnknownHostException
name
- The hostname to look up
UnknownHostException
- The hostname does not have any addressespublic static InetAddress[] getAllByName(String name) throws UnknownHostException
name
- The hostname to look up
UnknownHostException
- The hostname does not have any addressespublic static InetAddress getByAddress(String addr) throws UnknownHostException
addr
- The address, in string form
UnknownHostException
- The address is not a valid IP address.public static InetAddress getByAddress(String addr, int family) throws UnknownHostException
addr
- The address, in string formfamily
- The address family, either IPv4 or IPv6.
UnknownHostException
- The address is not a valid IP address in
the specified address family.public static String getHostName(InetAddress addr) throws UnknownHostException
addr
- The address to look up
UnknownHostException
- There is no hostname for the addresspublic static int familyOf(InetAddress address)
address
- The supplied address.
public static int addressLength(int family)
family
- The address family, either IPv4 or IPv6.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |