public Integer getBlockMaskPrefixLength ( boolean network ) { Integer prefixLen ; if ( network ) { if ( hasNoPrefixCache ( ) || ( prefixLen = prefixCache . networkMaskPrefixLen ) == null ) { prefixLen = setNetworkMaskPrefix ( checkForPrefixMask ( network ) ) ; } } else { if ( hasNoPrefixCache ( ) || ( prefixLen = prefixCache . hostMaskPrefixLen ) == null ) { prefixLen = setHostMaskPrefix ( checkForPrefixMask ( network ) ) ; } } if ( prefixLen < 0 ) { return null ; } return prefixLen ; }
If this address section is equivalent to the mask for a CIDR prefix block it returns that prefix length . Otherwise it returns null . A CIDR network mask is an address with all 1s in the network section and then all 0s in the host section . A CIDR host mask is an address with all 0s in the network section and then all 1s in the host section . The prefix length is the length of the network section .