9 [__DynamicallyInvokable]
21 [__DynamicallyInvokable]
29 _length = (s?.Length ?? 0);
41 [__DynamicallyInvokable]
42 protected override void Dispose(
bool disposing)
47 base.Dispose(disposing);
53 [__DynamicallyInvokable]
58 __Error.ReaderClosed();
70 [__DynamicallyInvokable]
75 __Error.ReaderClosed();
95 [__DynamicallyInvokable]
96 public override int Read([In] [Out]
char[] buffer,
int index,
int count)
110 if (buffer.Length - index < count)
116 __Error.ReaderClosed();
118 int num = _length - _pos;
125 _s.CopyTo(_pos, buffer, index, num);
135 [__DynamicallyInvokable]
140 __Error.ReaderClosed();
142 string result = (_pos != 0) ? _s.Substring(_pos, _length - _pos) : _s;
151 [__DynamicallyInvokable]
156 __Error.ReaderClosed();
159 for (i = _pos; i < _length; i++)
162 if (c ==
'\r' || c ==
'\n')
164 string result = _s.Substring(_pos, i - _pos);
166 if (c ==
'\r' && _pos < _length && _s[_pos] ==
'\n')
175 string result2 = _s.Substring(_pos, i - _pos);
188 [__DynamicallyInvokable]
200 [__DynamicallyInvokable]
219 [__DynamicallyInvokable]
226 if (index < 0 || count < 0)
230 if (buffer.Length - index < count)
250 [__DynamicallyInvokable]
257 if (index < 0 || count < 0)
261 if (buffer.Length - index < count)
265 return Task.FromResult(
Read(buffer, index, count));
The exception that is thrown when a null reference (Nothing in Visual Basic) is passed to a method th...
override int Read([In] [Out] char[] buffer, int index, int count)
Reads a block of characters from the input string and advances the character position by count .
The exception that is thrown when the value of an argument is outside the allowable range of values a...
override Task< int > ReadBlockAsync(char[] buffer, int index, int count)
Reads a specified maximum number of characters from the current string asynchronously and writes the ...
StringReader(string s)
Initializes a new instance of the T:System.IO.StringReader class that reads from the specified string...
Provides information about, and means to manipulate, the current environment and platform....
override Task< int > ReadAsync(char[] buffer, int index, int count)
Reads a specified maximum number of characters from the current string asynchronously and writes the ...
virtual int ReadBlock([In] [Out] char[] buffer, int index, int count)
Reads a specified maximum number of characters from the current text reader and writes the data to a ...
override Task< string > ReadToEndAsync()
Reads all characters from the current position to the end of the string asynchronously and returns th...
void Dispose()
Releases all resources used by the T:System.IO.TextReader object.
The exception that is thrown when one of the arguments provided to a method is not valid.
override string ReadLine()
Reads a line of characters from the current string and returns the data as a string.
override int Peek()
Returns the next available character but does not consume it.
override void Dispose(bool disposing)
Releases the unmanaged resources used by the T:System.IO.StringReader and optionally releases the man...
Represents a reader that can read a sequential series of characters.
override void Close()
Closes the T:System.IO.StringReader.
override int Read()
Reads the next character from the input string and advances the character position by one character.
Specifies that the class can be serialized.
override Task< string > ReadLineAsync()
Reads a line of characters asynchronously from the current string and returns the data as a string.
override string ReadToEnd()
Reads all characters from the current position to the end of the string and returns them as a single ...
Implements a T:System.IO.TextReader that reads from a string.
Represents an asynchronous operation that can return a value.