private int IncrementalRead(Array array, int index, int count)
{
if (array == null)
{
throw new ArgumentNullException((_incReadDecoder is IncrementalReadCharsDecoder) ? "buffer" : nameof(array));
}
if (count < 0)
{
throw new ArgumentOutOfRangeException((_incReadDecoder is IncrementalReadCharsDecoder) ? nameof(count): "len");
}
if (index < 0)
{
throw new ArgumentOutOfRangeException((_incReadDecoder is IncrementalReadCharsDecoder) ? nameof(index): "offset");
}
if (array.Length - index < count)
{
throw new ArgumentException((_incReadDecoder is IncrementalReadCharsDecoder) ? nameof(count): "len");
}
if (count == 0)
{
return 0;
}
_curNode.lineInfo = _incReadLineInfo;
_incReadDecoder.SetNextOutputBuffer(array, index, count);
IncrementalRead();
return _incReadDecoder.DecodedCount;
}