Class NetworkUtils

java.lang.Object
org.eblocker.server.common.network.NetworkUtils

public class NetworkUtils extends Object
IPv4 network utilities
  • Field Details

  • Method Details

    • getIPv4NetworkMask

      public static String getIPv4NetworkMask(int prefixLength)
    • getPrefixLength

      public static int getPrefixLength(String ipv4NetworkMask)
    • getIPv4NetworkAddress

      public static String getIPv4NetworkAddress(String ipAddress, String networkMask)
    • replaceLastByte

      public static String replaceLastByte(String ipv4Address, byte b)
    • isBeforeAddress

      public static boolean isBeforeAddress(String ip1, String ip2)
      Check whether ip1 is before/smaller than ip2 (precondition/required: both IPs are in the same network)
      Parameters:
      ip1 -
      ip2 -
      Returns: