Skip to content

Commit b12d4be

Browse files
Update strmreader read2.vb (#8959)
.NET source code clearly shows Read() may not return a fixed number of characters, but only what's currently available on the stream. ReadBlock returns the stated number of characters and only returns fewer if end of stream
1 parent 3b377b6 commit b12d4be

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

snippets/visualbasic/VS_Snippets_CLR/StrmReader Read2/VB/strmreader read2.vb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ Public Class Test
2424
Do While sr.Peek() >= 0
2525
'This is an arbitrary size for this example.
2626
Dim c(5) As Char
27-
sr.Read(c, 0, c.Length)
27+
sr.ReadBlock(c, 0, c.Length)
2828
'The output will look odd, because
2929
'only five characters are read at a time.
3030
Console.WriteLine(c)

0 commit comments

Comments
 (0)