if(!$len)thrownewDAV\Exception\LengthRequired('A Content-Length header is required');
switch($range[0]){
caseself::RANGE_START:
// Calculate the end-range if it doesn't exist.
if(!$range[2]){
$range[2]=$range[1]+$len-1;
}else{
if($range[2]<$range[1]){
thrownewDAV\Exception\RequestedRangeNotSatisfiable('The end offset ('.$range[2].') is lower than the start offset ('.$range[1].')');
}
if($range[2]-$range[1]+1!=$len){
thrownewDAV\Exception\RequestedRangeNotSatisfiable('Actual data length ('.$len.') is not consistent with begin ('.$range[1].') and end ('.$range[2].') offsets');