NotSupportedException when decompress a GZIP file #434

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

Originally created by @waldo2188 on GitHub (Jan 13, 2021).

Hi !
We encountered an error with version 0.27 when we tried to decompress a GZIP file. The method MoveToNextEntry() throw a NotSupportedException exception when the code tried to access to the Length property of class SharpCompress.IO.RewindableStream.

You can reproduce this behaviour with the code bellow and the file attached: simple.gz.

FileStream fStream = new FileStream("file/simple.gz", FileMode.Open);
using (SharpCompress.Readers.IReader reader = SharpCompress.Readers.ReaderFactory.Open(fStream))
{
	while (reader.MoveToNextEntry()) // Crash here
	{ }
}
Originally created by @waldo2188 on GitHub (Jan 13, 2021). Hi ! We encountered an error with version 0.27 when we tried to decompress a GZIP file. The method `MoveToNextEntry()` throw a `NotSupportedException` exception when the code tried to access to the `Length` property of class `SharpCompress.IO.RewindableStream`. You can reproduce this behaviour with the code bellow and the file attached: [simple.gz](https://github.com/adamhathcock/sharpcompress/files/5808002/simple.gz). ``` FileStream fStream = new FileStream("file/simple.gz", FileMode.Open); using (SharpCompress.Readers.IReader reader = SharpCompress.Readers.ReaderFactory.Open(fStream)) { while (reader.MoveToNextEntry()) // Crash here { } } ```
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/sharpcompress#434