public class IPResolver extends Object
| Constructor and Description |
|---|
IPResolver() |
| Modifier and Type | Method and Description |
|---|---|
static String |
getIP(InetAddress inetAddress)
Gets the ip address from the given InetAddress object as a String.
|
static byte[] |
getIPAsByte(InetAddress inetAddress)
Gets the ip address as a byte array.
|
static String |
getLocalIP()
Gets the local ip address as a String.
|
static byte[] |
getLocalIPAsByte()
Gets the local ip address as a byte array.
|
static InetAddress |
getLocalIPFromServerSocket(int port,
int backlog)
Gets the InetAddress object from the local host from a ServerSocket object.
|
static String |
getLocalIPFromServerSocketAsString()
Gets the ip address from the local host as String.
|
static String |
resolveIP(InetAddress inetAddress)
Resolves the ip address from the given InetAddress object.
|
public static String getIP(InetAddress inetAddress)
inetAddress - the inet addresspublic static byte[] getIPAsByte(InetAddress inetAddress)
inetAddress - the inet addresspublic static String getLocalIP() throws UnknownHostException
UnknownHostException - is thrown if the local host name could not be resolved into an address.public static byte[] getLocalIPAsByte()
throws UnknownHostException
UnknownHostException - is thrown if the local host name could not be resolved into an address.public static InetAddress getLocalIPFromServerSocket(int port, int backlog) throws UnknownHostException, IOException
port - the local TCP portbacklog - the listen backlogIOException - Signals that an I/O exception has occurred.UnknownHostException - is thrown if the local host name could not be resolved into an address.public static String getLocalIPFromServerSocketAsString() throws UnknownHostException, IOException
IOException - Signals that an I/O exception has occurred.UnknownHostException - is thrown if the local host name could not be resolved into an address.public static String resolveIP(InetAddress inetAddress)
inetAddress - the inet addressCopyright © 2015–2017 Alpha Ro Group UG (haftungsbeschrÀngt). All rights reserved.