public object[] GetRange(int index, int count)
{
if (index < 0)
{
throw new ArgumentOutOfRangeException("index", index, "Index can't be negative!");
}
if (count < 0)
{
throw new ArgumentOutOfRangeException("count", count, "Count can't be negative!");
}
object[] range = null;
AcquireReaderLock();
try
{
if (index > _list.Count - 1)
{
range = new object[0];
}
else
{
int avail = _list.Count - index;
count = Math.Min(count, avail);
range = new object[count];
for (int i=0; i<count; ++i)
{
range[i] = _list[index + i];
}
}
}
finally
{
ReleaseReaderLock();
}
return range;
}