Freigeben über


BinaryReader.Read Method (array<Char[], Int32, Int32)

Microsoft Silverlight will reach end of support after October 2021. Learn more.

Reads count characters from the stream with index as the starting point in the character array.

Namespace:  System.IO
Assembly:  mscorlib (in mscorlib.dll)

Syntax

'Declaration
<SecuritySafeCriticalAttribute> _
Public Overridable Function Read ( _
    buffer As Char(), _
    index As Integer, _
    count As Integer _
) As Integer
[SecuritySafeCriticalAttribute]
public virtual int Read(
    char[] buffer,
    int index,
    int count
)

Parameters

  • buffer
    Type: array<System.Char[]
    The buffer to read data into.
  • index
    Type: System.Int32
    The starting point in the buffer at which to begin reading into the buffer.
  • count
    Type: System.Int32
    The number of characters to read.

Return Value

Type: System.Int32
The total number of characters read into the buffer. This might be less than the number of characters requested if that many characters are not currently available, or it might be zero if the end of the stream is reached.

Exceptions

Exception Condition
ArgumentException

The buffer length minus index is less than count.

ArgumentNullException

buffer is nulla null reference (Nothing in Visual Basic).

ArgumentOutOfRangeException

index or count is negative.

ObjectDisposedException

The stream is closed.

IOException

An I/O error occurs.

Version Information

Silverlight

Supported in: 5, 4, 3

Silverlight for Windows Phone

Supported in: Windows Phone OS 7.1, Windows Phone OS 7.0

XNA Framework

Supported in: Xbox 360, Windows Phone OS 7.0

Platforms

For a list of the operating systems and browsers that are supported by Silverlight, see Supported Operating Systems and Browsers.