private static long calcSize(long size,long skip,long limit){
  return size >= 0 ? Math.max(-1,Math.min(size - skip,limit)) : -1;
}

private static long calcSize ( long size , long skip , long limit ) { return size >= 0 ? Math . max ( - 1 , Math . min ( size - skip , limit ) ) : - 1 ; }
calculates the sliced size given the current size , number of elements skip , and the number of elements to limit .
