Skip to content

Commit 38109c9

Browse files
authored
Document position advancement in MemoryStream.WriteByte
Added documentation to clarify that WriteByte advances the tream's position by one byte on success, matching the documentation style of the Write method. This addresses confusion about position behavior.
1 parent c9db664 commit 38109c9

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

xml/System.IO/MemoryStream.xml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2817,6 +2817,8 @@ The underlying buffer will not be exposed if the current `MemoryStream` instance
28172817
## Remarks
28182818
This method overrides <xref:System.IO.Stream.WriteByte%2A>.
28192819
2820+
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.
2821+
28202822
Except for a `MemoryStream` constructed with a byte[] parameter, write operations at the end of a `MemoryStream` expand the `MemoryStream`.
28212823
28222824

0 commit comments

Comments
 (0)