code: public static int getNetworkSegmentIndex(int networkPrefixLength, int bytesPerSegment, int bitsPerSegment) {
  		if(bytesPerSegment > 1) {
  			if(bytesPerSegment == 2) {
  				return (networkPrefixLength - 1) >> 4;//note this is intentionally a signed shift and not >>> so that networkPrefixLength of 0 returns -1
  			}
  			return (networkPrefixLength - 1) / bitsPerSegment;
  		}
  		return (networkPrefixLength - 1) >> 3;
  	}
docs: Returns the index of the segment containing the last byte within the network prefix
  When networkPrefixLength is zero (so there are no segments containing bytes within the network prefix), returns -1
  
  @param networkPrefixLength
  @param byteLength
  @return