1 public class InetAddress {
5 public InetAddress(byte[] addr, String hostname) {
6 this.hostname=hostname;
10 public static InetAddress getByAddress(String host, byte[] addr) {
11 return new InetAddress(addr, host);
14 public static InetAddress getByName(String hostname) {
15 InetAddress[] addresses=getAllByName(hostname);
19 public byte[] getAddress() {
23 public static InetAddress[] getAllByName(String hostname) {
24 InetAddress[] addresses;
26 byte[][] iplist = InetAddress.getHostByName(hostname.getBytes());
28 addresses = new InetAddress[iplist.length];
30 for (int i = 0; i < iplist.length; i++) {
31 addresses[i] = new InetAddress(iplist[i], hostname);
36 public static native byte[][] getHostByName(byte[] hostname);