/** * Creates an IPv4 address by masking it with a network mask of given * mask length. * * @param address the address to mask * @param prefixLength the length of the mask prefix. Must be in the * interval [0, 32] * @return a new IPv4 address that is masked with a mask prefix of the * specified length * @throws IllegalArgumentException if the prefix length is invalid */ public static Ip4Address makeMaskedAddress(final Ip4Address address, int prefixLength) { byte[] net = makeMaskedAddressArray(address, prefixLength); return Ip4Address.valueOf(net); } }