You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Not sure if this is considered a bug but the first example on the FileStream docs only works if you have a file with less than 1024 bytes or bytes%1024 == 0. This is due to the buffer byte array being reused.
If you use a 4 byte array and try read the string "hello" you end up with the following in the buffer
loop iteration 0: hell
loop iteration 1: oell
Activity
GSPP commentedon Feb 5, 2022
What a weird example anyway. So random, what's the idea behind it? Reminds me of the socket documentation.
jozkee commentedon Mar 10, 2022
Yes, it is a bit silly. Feel free to send a PR to propose an improved snippet.
Here's where you can find the snippets of the current ones:
dotnet-api-docs/xml/System.IO/FileStream.xml
Lines 94 to 96 in 77bcd7b
malghabr commentedon Mar 16, 2022
Sure I can pick this up when i have time
Fix snippet buffered read logic
Fix snippet buffered read logic
Fix snippet buffered read logic
Fix snippet buffered read logic (#8560)