question: public IPAddressName ( String name ) throws IOException { if ( name == null || name . length ( ) == 0 ) { throw new IOException ( "IPAddress cannot be null or empty" ) ; } if ( name . charAt ( name . length ( ) - 1 ) == '/' ) { throw new IOException ( "Invalid IPAddress: " + name ) ; } if ( name . indexOf ( ':' ) >= 0 ) { parseIPv6 ( name ) ; isIPv4 = false ; } else if ( name . indexOf ( '.' ) >= 0 ) { parseIPv4 ( name ) ; isIPv4 = true ; } else { throw new IOException ( "Invalid IPAddress: " + name ) ; } }
target:  Create an IPAddressName from a String. [IETF RFC1338 Supernetting & IETF RFC1519 Classless Inter-Domain Routing (CIDR)] For IPv4 addresses, the forms are "b1.b2.b3.b4" or "b1.b2.b3.b4/m1.m2.m3.m4", where b1 - b4 are decimal byte values 0-255 and m1 - m4 are decimal mask values 0 - 255. <p> [IETF RFC2373 IP Version 6 Addressing Architecture] For IPv6 addresses, the forms are "a1:a2:...:a8" or "a1:a2:...:a8/n", where a1-a8 are hexadecimal values representing the eight 16-bit pieces of the address. If /n is used, n is a decimal number indicating how many of the leftmost contiguous bits of the address comprise the prefix for this subnet. Internally, a mask value is created using the prefix length. <p>