"Memory stream is not expandable" exception #242

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

Originally created by @KvanTTT on GitHub (Oct 9, 2017).

I'm trying to extract MemoryStreamIsNotExpandable.zip with the following code:

using (Stream stream = File.OpenRead(sourceArchiveFileName))
{
    using (IReader reader = ReaderFactory.Open(stream))
    {  
        while (reader.MoveToNextEntry())
        {
           ...
        }
    }
}

But got "Memory stream is not expandable" exception after reading of big.png file at while (reader.MoveToNextEntry()) line. This file received from standard Mac compress utility.

With the reason of this error and how can we resolve it?

Originally created by @KvanTTT on GitHub (Oct 9, 2017). I'm trying to extract [MemoryStreamIsNotExpandable.zip](https://github.com/adamhathcock/sharpcompress/files/1369909/MemoryStreamIsNotExpandable.zip) with the following code: ```CSharp using (Stream stream = File.OpenRead(sourceArchiveFileName)) { using (IReader reader = ReaderFactory.Open(stream)) { while (reader.MoveToNextEntry()) { ... } } } ``` But got "Memory stream is not expandable" exception after reading of big.png file at `while (reader.MoveToNextEntry())` line. This file received from standard Mac compress utility. With the reason of this error and how can we resolve it?
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/sharpcompress#242