public static Long calculateRangeLength ( FileRequestContext context , Range range ) { if ( range . start == - 1 ) range . start = 0 ; if ( range . end == - 1 ) range . end = context . file . length ( ) - 1 ; range . length = range . end - range . start + 1 ; return range . length ; }
Calculates the length of a given range .