SteamRE / SteamKit

SteamKit2 is a .NET library designed to interoperate with Valve's Steam network. It aims to provide a simple, yet extensible, interface to perform various actions on the network.
GNU Lesser General Public License v2.1
2.57k stars 493 forks source link

Fix CA2022 warnings ahead of .NET 9 #1429

Closed yaakov-h closed 2 weeks ago

yaakov-h commented 2 weeks ago

The .NET 9 SDK introduces a new analyzer warning CA2022 that shows up when targeting .NET 9.

This fixes warnings about possible partial reads by using a new API from .NET 7, ReadExactly, rather than Read which can perform a partial read and relies on the caller to read in a loop.