public class GetIP extends Object
| Constructor and Description |
|---|
GetIP() |
| 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.
|
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 - the unknown host exceptionpublic static byte[] getLocalIPAsByte()
public static InetAddress getLocalIPFromServerSocket(int port, int backlog)
port - the local TCP portbacklog - the listen backlogpublic static String getLocalIPFromServerSocketAsString()
Copyright © 2007–2015 Alpha Ro Group UG (haftungsbeschrÀngt). All rights reserved.