Flush should probably not throw NotSupportedException #592

Closed
opened 2026-01-29 22:14:16 +00:00 by claunia · 4 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:16 +00:00
Author
Owner

@adamhathcock commented on GitHub (Sep 27, 2023):

Good catch and good PR

@adamhathcock commented on GitHub (Sep 27, 2023): Good catch and good PR
Author
Owner

@Kissaki commented on GitHub (May 6, 2025):

I assume this ticket should have been closed as resolved by merged PR #801?

@Kissaki commented on GitHub (May 6, 2025): I assume this ticket should have been closed as resolved by merged PR #801?
Author
Owner

@adamhathcock commented on GitHub (May 7, 2025):

It has...not sure why it hasn't auto closed

@adamhathcock commented on GitHub (May 7, 2025): It has...not sure why it hasn't auto closed
Author
Owner

@ite-jankl commented on GitHub (May 7, 2025):

There was no closing keyword like resolves or fixes in the PR :)

@ite-jankl commented on GitHub (May 7, 2025): There was no closing keyword like resolves or fixes in the PR :)
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/sharpcompress#592