根据long值获取ip v4地址

@param longIP IP的long表示形式
@return IP V4 地址
6751
public static String longToIpv4(long longIP) {
		final StringBuilder sb = new StringBuilder();
		// 直接右移24位
		sb.append(String.valueOf(longIP >>> 24));
		sb.append(".");
		// 将高8位置0，然后右移16位
		sb.append(String.valueOf((longIP & 0x00FFFFFF) >>> 16));
		sb.append(".");
		sb.append(String.valueOf((longIP & 0x0000FFFF) >>> 8));
		sb.append(".");
		sb.append(String.valueOf(longIP & 0x000000FF));
		return sb.toString();
	}
673945
public Long getLong(String key)
   {
      Long longValue = null;
      String sVal = getText(key);
      if ((sVal != null) && (sVal.length() > 0))
      {
         longValue = Long.valueOf(sVal);
      }
      return longValue;
   }
1174750
private static String getMultistageReverseProxyIp(String ip) {
		// 多级反向代理检测
		if (ip != null && ip.indexOf(",") > 0) {
			final String[] ips = ip.trim().split(",");
			for (String subIp : ips) {
				if (false == isUnknow(subIp)) {
					ip = subIp;
					break;
				}
			}
		}
		return ip;
	}
511179
public static long getLong(@NotNull ServletRequest request, @NotNull String param, long defaultValue) {
    String value = request.getParameter(param);
    return NumberUtils.toLong(value, defaultValue);
  }
699032
private final Long getLong(NamedList<Object> response, String... args) {
    Object objectItem = response.findRecursive(args);
    if (objectItem != null && objectItem instanceof Long) {
      return (Long) objectItem;
    } else {
      return null;
    }
  }
172058
public static long getLong( String key, long def ) {
        String s = prp.getProperty( key );
        if( s != null ) {
            try {
                def = Long.parseLong( s );
            } catch( NumberFormatException nfe ) {
                if( log.level > 0 )
                    nfe.printStackTrace( log );
            }
        }
        return def;
    }
425710
public long getLongProperty( String key , long defaultValue )
    {
        String value = SystemTools.replaceSystemProperties(settings.getProperty(key));
        if (value == null)
            return defaultValue;
        try
        {
            return Long.parseLong(value);
        }
        catch (Exception e)
        {
            return defaultValue;
        }
    }
716534
public Long queryLong(String paramName, Long defaultValue) {
        return this.request.queryLong(paramName, defaultValue);
    }
252164
private static long getIPAddress()
    {
        if (tc.isEntryEnabled())
            Tr.entry(tc, "getIPAddress");

        int lower32Bits = 0;

        try
        {
            final byte[] address = AccessController.doPrivileged(new PrivilegedExceptionAction<byte[]>() {
                @Override
                public byte[] run() throws UnknownHostException {
                    return java.net.InetAddress.getLocalHost().getAddress();

                }
            });

            lower32Bits = ((address[0] & 0xFF) << 24)
                          | ((address[1] & 0xFF) << 16)
                          | ((address[2] & 0xFF) << 8)
                          | ((address[3] & 0xFF) << 0);

        } catch (PrivilegedActionException paex) {
            com.ibm.ws.ffdc.FFDCFilter.processException(paex.getCause(), "com.ibm.ws.util.UUID.getIPAddress", "794");
            if (tc.isEventEnabled())
                Tr.event(tc, "Exception caught getting host address.", paex.getCause());

            // Try random number instead!
            lower32Bits = new java.util.Random().nextInt();
        } catch (Exception e) // Host address unavailable
        {
            com.ibm.ws.ffdc.FFDCFilter.processException(e, "com.ibm.ws.util.UUID.getIPAddress", "661");
            if (tc.isEventEnabled())
                Tr.event(tc, "Exception caught getting host address.", e);

            // Try random number instead!
            lower32Bits = new java.util.Random().nextInt();
        }

        final long ipAddress = lower32Bits & 0x00000000FFFFFFFFL;

        if (tc.isEntryEnabled())
            Tr.exit(tc, "getIPAddress", Long.valueOf(ipAddress));
        return ipAddress;
    }
1138147
public static String getLocalIpv4() {
        InetAddress address = getLocalAddress();
        return address == null ? null : address.getHostAddress();
    }
1143506
public T get(final long _id)
    {
        return getCache4Id() == null ? null : getCache4Id().get(new Long(_id));
    }
429065
public List<String> getCallbackIP() {
        LOG.debug("获取微信服务器IP地址......");
        List<String> result = null;
        String url = BASE_API_URL + "cgi-bin/getcallbackip?access_token=#";
        BaseResponse r = executeGet(url);
        if (isSuccess(r.getErrcode())) {
            JSONArray array = JSON.parseObject(r.getErrmsg()).getJSONArray("ip_list");
            result = CollectionUtil.newArrayList(array.size());
            for (Object obj : array) result.add(obj.toString());
        }
        return result;
    }

    /**
     * 将一条长链接转成短链接
     *
     * @param longUrl 长链接
     * @return 对应的短链接
     */
    public String getShortUrl(String longUrl) {
        String result = "";
        LOG.debug("获取短URL.......");
        if (checkUrl(longUrl)) {
            String url = BASE_API_URL + "cgi-bin/shorturl?access_token=#";
            Map<String, String> params = new HashMap<String, String>();
            params.put("action", "long2short");
            params.put("long_url", longUrl);
            BaseResponse r = executePost(url, JSONUtil.toJson(params));
            if (isSuccess(r.getErrcode())) {
                result = JSONUtil.toMap(r.getErrmsg()).get("short_url").toString();
            }
        }
        return result;
    }

    /**
     * 检查URL是否支持
     *
     * @param url 需要检查的URL
     * @return 是否支持
     */
    private boolean checkUrl(String url) {
        return StrUtil.isNotBlank(url) && (url.startsWith("http://") || url.startsWith("https://") || url.startsWith("weixin://wxpay"));
    }
}
954940
public static long getLong(String name, long defaultVal){
        if(getConfiguration().containsKey(name)){
            return getConfiguration().getLong(name);
        } else {
            return defaultVal;
        }
    }
891238
public static Long convertVarNumberToLong(RLPElement rpe) {
		Long result=0L;
		if (rpe.getRawData()!=null) {
			if (rpe.getRawData().length==0) {
				result=0L;
			} else
			if (rpe.getRawData().length<2) {
				result=(long) EthereumUtil.convertToByte(rpe);
			} else if (rpe.getRawData().length<3) {
				result = (long) EthereumUtil.convertToShort(rpe);
			} else if (rpe.getRawData().length<5) {
				result=(long) EthereumUtil.convertToInt(rpe);
			} else if (rpe.getRawData().length<9) {
				result=EthereumUtil.convertToLong(rpe);
			}
		}
		return result;
}
1236124
public java.util.List<IpRange> getIpv4Ranges() {
        if (ipv4Ranges == null) {
            ipv4Ranges = new com.amazonaws.internal.SdkInternalList<IpRange>();
        }
        return ipv4Ranges;
    }
302237
public static function safeIp2long($ip) 
    {
        $ip = ip2long($ip);

        // convert signed int to unsigned int if on 32 bit operating system
        if ($ip < 0 && PHP_INT_SIZE == 4) {
            $ip = sprintf("%u", $ip);
        } 

        return $ip;
    }
268847
private function ip2long($ip)
    {
        $ip_arr = explode('.', $ip);
        $iplong = (16777216 * intval($ip_arr[0])) + (65536 * intval($ip_arr[1])) + (256 * intval($ip_arr[2])) + intval($ip_arr[3]);

        return $iplong;
    }