/** * Converts byte array to {@link Ipv6Prefix} with specified prefixLength */ public static Ipv6Prefix arrayToIpv6Prefix(final byte[] address, byte prefixLength) { Ipv6AddressNoZone addressPart = arrayToIpv6AddressNoZone(address); return new Ipv6Prefix(addressPart.getValue().concat("/").concat(String.valueOf(prefixLength))); }
/** * Converts array bytes to {@link IpAddress} */ @Nonnull public static IpAddress arrayToIpAddress(boolean isIpv6, byte[] ip) { if (isIpv6) { return new IpAddress(arrayToIpv6AddressNoZone(ip)); } else { return new IpAddress(arrayToIpv4AddressNoZone(ip)); } }