question: public boolean isInNet ( String host , String pattern , String mask ) { host = dnsResolve ( host ) ; if ( host == null || host . length ( ) == 0 ) { return false ; } long lhost = parseIpAddressToLong ( host ) ; long lpattern = parseIpAddressToLong ( pattern ) ; long lmask = parseIpAddressToLong ( mask ) ; return ( lhost & lmask ) == lpattern ; }
target:  Returns true if the IP address of the host matches the specified IP address pattern. Pattern and mask specification is done the same way as for SOCKS configuration. Example: isInNet(host, "198.95.0.0", "255.255.0.0") is true if the IP address of the host matches 198.95.*.*.