TextReader.ReadBlock TextReader.ReadBlock TextReader.ReadBlock TextReader.ReadBlock Method

Definición

Sobrecargas

ReadBlock(Span<Char>) ReadBlock(Span<Char>) ReadBlock(Span<Char>) ReadBlock(Span<Char>)
ReadBlock(Char[], Int32, Int32) ReadBlock(Char[], Int32, Int32) ReadBlock(Char[], Int32, Int32) ReadBlock(Char[], Int32, Int32)

Lee un número máximo de caracteres especificado en el lector de texto actual y escribe los datos en un búfer, comenzando en el índice especificado.Reads a specified maximum number of characters from the current text reader and writes the data to a buffer, beginning at the specified index.

ReadBlock(Span<Char>) ReadBlock(Span<Char>) ReadBlock(Span<Char>) ReadBlock(Span<Char>)

public:
 virtual int ReadBlock(Span<char> buffer);
public virtual int ReadBlock (Span<char> buffer);
abstract member ReadBlock : Span<char> -> int
override this.ReadBlock : Span<char> -> int
Public Overridable Function ReadBlock (buffer As Span(Of Char)) As Integer

Parámetros

buffer
Span<Char>

Devoluciones

ReadBlock(Char[], Int32, Int32) ReadBlock(Char[], Int32, Int32) ReadBlock(Char[], Int32, Int32) ReadBlock(Char[], Int32, Int32)

Lee un número máximo de caracteres especificado en el lector de texto actual y escribe los datos en un búfer, comenzando en el índice especificado.Reads a specified maximum number of characters from the current text reader and writes the data to a buffer, beginning at the specified index.

public:
 virtual int ReadBlock(cli::array <char> ^ buffer, int index, int count);
public virtual int ReadBlock (char[] buffer, int index, int count);
abstract member ReadBlock : char[] * int * int -> int
override this.ReadBlock : char[] * int * int -> int
Public Overridable Function ReadBlock (buffer As Char(), index As Integer, count As Integer) As Integer

Parámetros

buffer
Char[]

Cuando este método devuelve un valor, este parámetro contiene la matriz de caracteres especificada con valores entre index y (index + count -1) reemplazada por los caracteres leídos del origen actual.When this method returns, this parameter contains the specified character array with the values between index and (index + count -1) replaced by the characters read from the current source.

index
Int32 Int32 Int32 Int32

Lugar de buffer en el que comenzará la escritura.The position in buffer at which to begin writing.

count
Int32 Int32 Int32 Int32

Número máximo de caracteres que se van a leer.The maximum number of characters to read.

Devoluciones

Número de caracteres que se han leído.The number of characters that have been read. Este número será menor o igual que count, dependiendo de si se han leído todos los caracteres de entrada.The number will be less than or equal to count, depending on whether all input characters have been read.

Excepciones

La longitud del búfer menos index es menor que count.The buffer length minus index is less than count.

Error de E/S.An I/O error occurs.

Comentarios

La posición del lector de texto subyacente se avanza por el número de caracteres leídos en buffer.The position of the underlying text reader is advanced by the number of characters that were read into buffer.

El método se bloquea hasta count que se leen ambos caracteres o se han leído todos los caracteres.The method blocks until either count characters are read, or all characters have been read. Se trata de una versión de Readbloqueo de.This is a blocking version of Read.

Consulte también:

Se aplica a