Class IPUtils
java.lang.Object
ru.bgcrm.util.inet.IPUtils
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic Stringbase64ToString(String base64Addr) Converts a BASE64-encoded byte[] address to a human-readable stringstatic intconvertBytesToInt(byte[] bytes) Converts a byte array to a decimal int valuestatic byte[]convertIntToBytes(int value) Converts an int value to a byte array representationstatic final StringconvertIpToString(int ip) Converts an IP from a signed decimal number (4 bytes) to dotted notationstatic final intunsignedByteToInt(byte value) Converts a byte to an unsigned int
-
Constructor Details
-
IPUtils
public IPUtils()
-
-
Method Details
-
convertIpToString
Converts an IP from a signed decimal number (4 bytes) to dotted notation- Parameters:
ip- the IP as a signed decimal number- Returns:
- the dotted-notation string
-
convertIntToBytes
public static byte[] convertIntToBytes(int value) Converts an int value to a byte array representation- Parameters:
value- the input value- Returns:
- the byte array
-
unsignedByteToInt
public static final int unsignedByteToInt(byte value) Converts a byte to an unsigned int- Parameters:
value- the input byte- Returns:
- the unsigned int value
-
convertBytesToInt
public static int convertBytesToInt(byte[] bytes) Converts a byte array to a decimal int value- Parameters:
bytes- the byte array- Returns:
- the int value
-
base64ToString
-