/** * Converts an IP address to a subnet using the provided mask * * @param address * The address to convert into a subnet * @return The subnet as an integer */ private long toSubnet(InetAddress address) { if (address instanceof Inet4Address) { return toInt(address) & (int) subnetMask; } else { return toLong(address) & subnetMask; } }
/** * Converts an IP address to a subnet using the provided mask * * @param address * The address to convert into a subnet * @return The subnet as an integer */ private long toSubnet(InetAddress address) { if (address instanceof Inet4Address) { return toInt(address) & (int) subnetMask; } else { return toLong(address) & subnetMask; } }
} else { this.subnet = subnet; subnetLong = toLong(subnet); this.suffix = mask;
} else { this.subnet = subnet; subnetLong = toLong(subnet); this.suffix = mask;