change ipv4util getBeginIpLong to public

This commit is contained in:
不忘初心 2022-01-18 11:09:51 +00:00 committed by Gitee
parent db5bd528ce
commit 7ef7ac52f0
No known key found for this signature in database
GPG Key ID: 173E9B9CA92EEF8F

View File

@ -187,7 +187,7 @@ public class Ipv4Util {
* @param maskBit 给定的掩码位如30
* @return 起始IP的长整型表示
*/
private static Long getBeginIpLong(String ip, int maskBit) {
public static Long getBeginIpLong(String ip, int maskBit) {
return ipv4ToLong(ip) & ipv4ToLong(getMaskByMaskBit(maskBit));
}
@ -348,7 +348,7 @@ public class Ipv4Util {
* @param maskBit 给定的掩码位如30
* @return 终止IP的长整型表示
*/
private static Long getEndIpLong(String ip, int maskBit) {
public static Long getEndIpLong(String ip, int maskBit) {
return getBeginIpLong(ip, maskBit)
+ ~ipv4ToLong(getMaskByMaskBit(maskBit));
}