mirror of
https://github.com/BepInEx/dotnet-runtime.git
synced 2026-11-22 19:10:41 -10:00
* Add Stream argument validation helpers and use throughout dotnet/runtime * Delete unnecessary code in Stream Stream.Null was using BlockingBegin/EndRead/Write, but the operations are nops (they don't even do argument validation), so the functionality was unnecessary complication. We can just use TaskToApm instead, with already completed tasks, and then also delete the SynchronousAsyncResult that was used by these operations. Also, the Begin/EndRead/Write methods were checking CanRead/Write and throwing if they return false, but this is a private sealed type with CanRead/Write hardcoded to return true! Delete. Finally added consistency across Stream.Null to checking for cancellation. * Clean up some style on Stream Also consolidate a few resources and use a few existing ThrowHelpers where appropriate. * Fix a few issues, and remove duplicative tests missed in conformance tests rollout * Address PR feedback