Terraria v1.4.4.9
Terraria source code documentation
Loading...
Searching...
No Matches

◆ Read() [2/3]

override int System.IO.StringReader.Read ( char[] buffer,
int index,
int count )
inlinevirtual

Reimplemented from System.IO.TextReader.

Definition at line 63 of file StringReader.cs.

64 {
65 if (buffer == null)
66 {
67 throw new ArgumentNullException("buffer", SR.ArgumentNull_Buffer);
68 }
69 if (index < 0)
70 {
71 throw new ArgumentOutOfRangeException("index", SR.ArgumentOutOfRange_NeedNonNegNum);
72 }
73 if (count < 0)
74 {
75 throw new ArgumentOutOfRangeException("count", SR.ArgumentOutOfRange_NeedNonNegNum);
76 }
77 if (buffer.Length - index < count)
78 {
79 throw new ArgumentException(SR.Argument_InvalidOffLen);
80 }
81 if (_s == null)
82 {
83 throw new ObjectDisposedException(null, SR.ObjectDisposed_ReaderClosed);
84 }
85 int num = _length - _pos;
86 if (num > 0)
87 {
88 if (num > count)
89 {
90 num = count;
91 }
92 _s.CopyTo(_pos, buffer, index, num);
93 _pos += num;
94 }
95 return num;
96 }

References System.IO.StringReader._length, System.IO.StringReader._pos, System.IO.StringReader._s, System.SR.Argument_InvalidOffLen, System.SR.ArgumentNull_Buffer, System.SR.ArgumentOutOfRange_NeedNonNegNum, System.buffer, System.count, System.index, and System.SR.ObjectDisposed_ReaderClosed.