-
Notifications
You must be signed in to change notification settings - Fork 5.3k
Closed
Labels
area-System.IOblocking-releasebuguntriagedNew issue has not been triaged by the area ownerNew issue has not been triaged by the area owner
Milestone
Description
Every use we have of RandomAccess.Write{Async} now is incorrect, as they all assume the methods will fully write all the data that was supplied. This highlights how error-prone the current design is, with Write not guaranteeing this and instead returning the number of bytes written. We've trained developers with every other Write method in .NET that such methods write all the supplied data (in contrast to Read methods which may not fill the supplied buffer).
We should change the RandomAccess.Write{Async} methods to return void/ValueTask.
If we don't do that, every use of RandomAccess.Write{Async} needs to be fixed, and an analyzer needs to be written that warns when the result isn't consumed.
cc: @adamsitnik, @jeffhandley
Metadata
Metadata
Assignees
Labels
area-System.IOblocking-releasebuguntriagedNew issue has not been triaged by the area ownerNew issue has not been triaged by the area owner