Urgent.News

What's breaking now, across thousands of outlets.

Tech

.NET 10 BufferedStream WriteByte: Flush Full Buffers Explicitly

BufferedStream.WriteByte had a surprising side effect through .NET 9: the call at its internal capacity boundary also called Flush() on the wrapped stream. The .NET 10 BufferedStream WriteByte behavior removes that implicit flush. Bytes can still move to the underlying stream when the buffer needs room, but that capacity boundary no longer becomes an accidental flush boundary. That distinction…

In .NET 10, the behavior of BufferedStream.WriteByte has changed, removing the implicit flush that occurred at the internal capacity boundary. This change was introduced in .NET 10 LTS, not as a preview feature, and is stable behavior. The modification affects applications that rely on the previous behavior of Flush() being called at the capacity boundary, particularly when using custom streams, protocol adapters, compressors, or test doubles where Flush() has additional meaning.

The change ensures that bytes can still be moved to the underlying stream when the buffer needs more space, but the capacity boundary no longer results in an accidental flush. Microsoft documents this behavior change for .NET 10, emphasizing that WriteByte now differs from other BufferedStream.Write methods in its behavior.

Brief written by urgent.news from Dev.to's own syndicated text. Machine-written — may contain errors; check the original before relying on it.

Read the original at dev.to →

More in Tech

The highlights of Gamescom Opening Night Live 2026

GamesIndustry.biz was at Gamescom Opening Night Live on Tuesday night, the eighth instalment of the digital showcase. The hall was packed, without an empty seat in sight, and there were plenty of gaming celebrities in attendance: Xbox head Asha Sharma could be seen near the front, gamely forming an 'X' with her arms as the camera panned…

More from Tuesday 25 August →