Not implemented Stream methods are expected to throw NotSupportedException #409

Open
opened 2026-01-29 22:11:30 +00:00 by claunia · 2 comments
Owner

Originally created by @claunia on GitHub (Aug 24, 2020).

Hi,

As in
https://github.com/adamhathcock/sharpcompress/blob/master/src/SharpCompress/Compressors/LZMA/LZipStream.cs#L108

all other software expects that to throw a NotSupportedException as a normal condition to detect they cannot seek or get the size, however throwing a NotImplementedException makes other libraries (e.g. DotNetZip) not work properly.

E.g.:
fbad143e71/src/Zip.Shared/ZipEntry.Write.cs (L1510)

Originally created by @claunia on GitHub (Aug 24, 2020). Hi, As in https://github.com/adamhathcock/sharpcompress/blob/master/src/SharpCompress/Compressors/LZMA/LZipStream.cs#L108 all other software expects that to throw a NotSupportedException as a normal condition to detect they cannot seek or get the size, however throwing a NotImplementedException makes other libraries (e.g. DotNetZip) not work properly. E.g.: https://github.com/haf/DotNetZip.Semverd/blob/fbad143e71ab3069b1bd7ae17eabb81543747457/src/Zip.Shared/ZipEntry.Write.cs#L1510
claunia added the bugup for grabs labels 2026-01-29 22:11:30 +00:00
Author
Owner

@adamhathcock commented on GitHub (Aug 25, 2020):

Happy to change the exception if you don't mind submitting a PR to clean that exception (and possibly other locations)

@adamhathcock commented on GitHub (Aug 25, 2020): Happy to change the exception if you don't mind submitting a PR to clean that exception (and possibly other locations)
Author
Owner

@ds5678 commented on GitHub (Dec 23, 2022):

I think this has been already resolved.

@ds5678 commented on GitHub (Dec 23, 2022): I think this has been already resolved.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/sharpcompress#409