What is the difference between Read () and ReadBlock () calls in TextReader?

The name more or less speaks of everything. Calls are documented:

Here for TextReader.Read Method (Char[], Int32, Int32) and
Here for TextReader.ReadBlock()with the same types of arguments.

I want to extract the part of a byte array for which I am creating MemoryStream, which I intend to read with StreamReader, for example:

    StreamReader r = new StreamReader(new MemoryStream(rawData, 0, 184, false, false));
    r.Read.....

What benefits should I use? Is one of them faster or better?

+3
source share
1 answer

- , Read() , . , Read(), , ReadBlock().

"" ReadBlock , "" . , , .

Reflector StreamReader.ReadBlock( TextReader.ReadBlock), , , "" , "" 0 . , "" , .

+5

All Articles