protected Long encodeRangeShift(final Long val,final Long minValue){
  if (minValue == null) {
    return val;
  }
  if (val < minValue) {
    throw new RuntimeException("Illegal range shift -- datatype violation.");
  }
  return Long.MIN_VALUE + (val - minValue);
}

protected Long encodeRangeShift ( final Long val , final Long minValue ) { if ( minValue == null ) { return val ; } if ( val < minValue ) { throw new RuntimeException ( "Illegal range shift -- datatype violation." ) ; } return Long . MIN_VALUE + ( val - minValue ) ; }
shift values according to the minvalue , making sure that we encode the lowest value in the range as the lowest value 00000000 . . . when encoded as byte array . implements steps c - > d1 .
