code: public static Integer getNetworkPrefixLength(int bitsPerSegment, int segmentPrefixLength, int segmentIndex) {
  		int increment = (bitsPerSegment == 8) ? segmentIndex << 3 : ((bitsPerSegment == 16) ? segmentIndex << 4 :  segmentIndex * bitsPerSegment);
  		return increment + segmentPrefixLength;
  	}
docs: Translates a non-null segment prefix length into an address prefix length.
  When calling this for the first segment with a non-null prefix length, this gives the overall prefix length.
  <p>
  Across an address prefixes are:
  IPv6: (null):...:(null):(1 to 16):(0):...:(0)
  or IPv4: ...(null).(1 to 8).(0)...