dotnet-api-docs icon indicating copy to clipboard operation
dotnet-api-docs copied to clipboard

Document position advancement in MemoryStream.WriteByte

Open oii-nasif opened this issue 3 months ago • 0 comments

Fixes #10163

Summary

  • Added documentation to MemoryStream.WriteByte to clarify that the method advances the stream's position by one byte upon successful write
  • Mirrors the documentation style used in the Write method for consistency

Details

The WriteByte() method documentation was missing information about position advancement, which was present in the Write() method documentation. This omission could confuse developers about how the stream's position changes when using this method.

Changes Made

Added the following clarification to the Remarks section:

If the write operation is successful, the current position within the stream advances by one byte. If an exception occurs, the current position within the stream is unchanged.

This matches the documentation pattern used in Write() and provides developers with clear expectations about position behavior.

oii-nasif avatar Oct 03 '25 23:10 oii-nasif