Compartilhar via


TextSnapshotToTextReader.Read Method (array<Char , Int32, Int32)

Reads the specified number of characters from the current stream and writes the data to the buffer, beginning at the specified location.

Namespace:  Microsoft.VisualStudio.Text
Assembly:  Microsoft.VisualStudio.Text.Data (in Microsoft.VisualStudio.Text.Data.dll)

Syntax

'Declaration
Public Overrides Function Read ( _
    buffer As Char(), _
    index As Integer, _
    count As Integer _
) As Integer
public override int Read(
    char[] buffer,
    int index,
    int count
)
public:
virtual int Read(
    array<wchar_t>^ buffer, 
    int index, 
    int count
) override
abstract Read : 
        buffer:char[] * 
        index:int * 
        count:int -> int  
override Read : 
        buffer:char[] * 
        index:int * 
        count:int -> int
public override function Read(
    buffer : char[], 
    index : int, 
    count : int
) : int

Parameters

  • buffer
    Type: array<Char[]

    When this method returns, contains the specified character array from the current source.

  • index
    Type: Int32

    The place in buffer at which to begin writing.

  • count
    Type: Int32

    The maximum number of characters to read.

Return Value

Type: Int32
The number of characters that have been read. The number will be less than or equal to count, depending on whether the data is available within the stream. This method returns zero if called when no more characters are left to read.

Exceptions

Exception Condition
ArgumentNullException

buffer is null.

ArgumentOutOfRangeException

index or count is negative, or the buffer length minus index is less than count.

ObjectDisposedException

The reader is closed.

.NET Framework Security

See Also

Reference

TextSnapshotToTextReader Class

Read Overload

Microsoft.VisualStudio.Text Namespace