Package org.miaixz.bus.core.net
Class MaskBit
java.lang.Object
org.miaixz.bus.core.net.MaskBit
掩码位和掩码之间的Map对应
- Since:
- Java 17+
- Author:
- Kimi Liu
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic Stringget(int maskBit) 根据掩码位获取掩码static IntegergetMaskBit(String mask) 根据掩码获取掩码位static longgetMaskIpLong(int maskBit) 根据掩码位获取掩码IP(Long型)
-
Constructor Details
-
MaskBit
public MaskBit()
-
-
Method Details
-
get
根据掩码位获取掩码- Parameters:
maskBit- 掩码位- Returns:
- 掩码
-
getMaskBit
根据掩码获取掩码位- Parameters:
mask- 掩码的点分十进制表示,如 255.255.255.0- Returns:
- 掩码位,如 24;如果掩码不合法,则返回null
-
getMaskIpLong
public static long getMaskIpLong(int maskBit) 根据掩码位获取掩码IP(Long型)- Parameters:
maskBit- 掩码位- Returns:
- 掩码IP(Long型)
-