Class IPUtils

java.lang.Object
ru.bgcrm.util.inet.IPUtils

public class IPUtils extends Object
  • Constructor Details

    • IPUtils

      public IPUtils()
  • Method Details

    • convertIpToString

      public static final String convertIpToString(int ip)
      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

      public static String base64ToString(String base64Addr)
      Converts a BASE64-encoded byte[] address to a human-readable string
      Parameters:
      base64Addr - the BASE64-encoded address
      Returns:
      the human-readable string