public static int [ ] toArray ( String s , int family ) { byte [ ] byteArray = toByteArray ( s , family ) ; if ( byteArray == null ) return null ; int [ ] intArray = new int [ byteArray . length ] ; for ( int i = 0 ; i < byteArray . length ; i ++ ) intArray [ i ] = byteArray [ i ] & 0xFF ; return intArray ; }
Convert a string containing an IP address to an array of 4 or 16 integers .