Flush should probably not throw NotSupportedException #590

Open
opened 2026-01-29 22:14:14 +00:00 by claunia · 0 comments
Owner

Originally created by @carlreinke on GitHub (Sep 26, 2023).

According to the Stream.Flush docs:

In a class derived from Stream that doesn't support writing, Flush is typically implemented as an empty method to ensure full compatibility with other Stream types since it's valid to flush a read-only stream.

66c92637f9/src/SharpCompress/Compressors/LZMA/DecoderStream.cs (L17)

Originally created by @carlreinke on GitHub (Sep 26, 2023). According to the [Stream.Flush](https://learn.microsoft.com/en-us/dotnet/api/system.io.stream.flush) docs: > In a class derived from [Stream](https://learn.microsoft.com/en-us/dotnet/api/system.io.stream?view=net-7.0) that doesn't support writing, [Flush](https://learn.microsoft.com/en-us/dotnet/api/system.io.stream.flush?view=net-7.0) is typically implemented as an empty method to ensure full compatibility with other [Stream](https://learn.microsoft.com/en-us/dotnet/api/system.io.stream?view=net-7.0) types since it's valid to flush a read-only stream. https://github.com/adamhathcock/sharpcompress/blob/66c92637f9f5c07f9d644d40975833c6ba256190/src/SharpCompress/Compressors/LZMA/DecoderStream.cs#L17
claunia added the bugup for grabs labels 2026-01-29 22:14:14 +00:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/sharpcompress#590