public NetAddress[] getAddressesByName(String hostname) throws UnknownHostException, UnsupportedOperationException {
        // check parameter
        if (hostname==null) {
            throw new UnknownHostException("hostname=null");
        }
        
        // action
        try {
            Object inetAddressesObj = lookupAllHostAddrMethod.invoke(inetAddressImpl, hostname);
            if (inetAddressesObj==null) {

                // no result
                throw new UnknownHostException("hostname="+hostname+" could not be resolved");
                
            } else if (inetAddressesObj instanceof byte[][]) {

                // this seams to be Java 1.5
                byte[][] inetAddresses = (byte[][])inetAddressesObj;
                NetAddress[] result = new NetAddress[inetAddresses.length];
                for (int i=0; i<inetAddresses.length; i++) {
                    result[i] = new IpNetAddress(inetAddresses[i]);
                }
                return result;

            } else {

                // this is Java 1.6 or higher
                InetAddress[] inetAddresses = (InetAddress[])inetAddressesObj;
                NetAddress[] result = new NetAddress[inetAddresses.length];
                for (int i=0; i<inetAddresses.length; i++) {
                    result[i] = new IpNetAddress(inetAddresses[i]);
                }
                return result;
            }

        } catch (UnknownHostException e) {
            throw e;

        } catch (InvocationTargetException e) {
            if (e.getTargetException() instanceof UnknownHostException) {
                // re-throw the original exception
                throw (UnknownHostException)e.getTargetException();
            }
            throw new UnsupportedOperationException("resolution failed (1) for hostname="+hostname, e);
            
        } catch (Exception e) {
            throw new UnsupportedOperationException("resolution failed (2) for hostname="+hostname, e);
        }
    }