public static function getByAddress($address, $hostname = null)
    {
        $addrLen = strlen($address);
        if ($addrLen === 4) {
            return new Inet4Address($address, $hostname);
        } elseif ($addrLen == 16) {
            return new Inet6Address($address, $hostname);
        }

        throw new UnknownHostException($address);
    }