You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Updated the `ReadToEnd` and `ReadToEndAsync` methods in the `StreamExtensions` class to include a `leaveOpen` boolean parameter. This allows the caller to control whether the stream remains open after reading. If set to `false`, the stream will be disposed. XML documentation comments have been added to describe the new parameter.
Copy file name to clipboardExpand all lines: Sources/EasyExtensions/Extensions/StreamExtensions.cs
+14-2Lines changed: 14 additions & 2 deletions
Original file line number
Diff line number
Diff line change
@@ -14,29 +14,41 @@ public static class StreamExtensions
14
14
/// <summary>
15
15
/// Reads the bytes from the current stream and writes them to the byte array.
16
16
/// </summary>
17
+
/// <param name="stream"> The stream to read from. </param>
18
+
/// <param name="leaveOpen"> If true, the stream will not be disposed after reading. </param>
17
19
/// <returns> Received byte array. </returns>
18
20
/// <exception cref="IOException"> An I/O error occurred. </exception>
19
21
/// <exception cref="ArgumentNullException"> Destination is null. </exception>
20
22
/// <exception cref="ObjectDisposedException"> Either the current stream or the destination stream is disposed. </exception>
21
23
/// <exception cref="NotSupportedException"> The current stream does not support reading, or the destination stream does not support writing. </exception>
/// Asynchronously reads the bytes from the current stream and writes them to the byte array.
31
37
/// </summary>
38
+
/// <param name="stream"> The stream to read from. </param>
39
+
/// <param name="leaveOpen"> If true, the stream will not be disposed after reading. </param>
32
40
/// <returns> Received byte array. </returns>
33
41
/// <exception cref="ArgumentNullException"> Destination is null. </exception>
34
42
/// <exception cref="ObjectDisposedException"> Either the current stream or the destination stream is disposed. </exception>
35
43
/// <exception cref="NotSupportedException"> The current stream does not support reading, or the destination stream does not support writing. </exception>
0 commit comments