public DiskRange span ( DiskRange otherDiskRange ) { requireNonNull ( otherDiskRange , "otherDiskRange is null" ) ; long start = Math . min ( this . offset , otherDiskRange . getOffset ( ) ) ; long end = Math . max ( getEnd ( ) , otherDiskRange . getEnd ( ) ) ; return new DiskRange ( start , toIntExact ( end - start ) ) ; }
Returns the minimal DiskRange that encloses both this DiskRange and otherDiskRange . If there was a gap between the ranges the new range will cover that gap .