BinaryReaderReadChars Method |
Reads the specified number of characters from the current stream, returns the data in a character array, and advances the current position in accordance with the Encoding used and the specific character being read from the stream.
Namespace: System.IOAssembly: mscorlib (in mscorlib.dll) Version: 4.0.0.0
Syntax public virtual char[] ReadChars(
int count
)
Parameters
- count
- Type: SystemInt32
The number of characters to read.
Return Value
Type:
CharA character array containing data read from the underlying stream. This might be less than the number of characters requested if the end of the stream is reached.
Exceptions Exception | Condition |
---|
ArgumentException | The number of decoded characters to read is greater than count. This can happen if a Unicode decoder returns fallback characters or a surrogate pair. |
ObjectDisposedException | The stream is closed. |
IOException | An I/O error occurs. |
ArgumentOutOfRangeException | count is negative. |
See Also