mirror of
https://github.com/adamhathcock/sharpcompress.git
synced 2026-02-06 21:26:07 +00:00
OpenEntryStream returns empty stream #475
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @nikoslyk203 on GitHub (Sep 21, 2021).
I have downloaded a zip file as a stream through HttpClient in C# and I am trying to open one of the files inside the archive as a stream but for some reason when I use OpenEntryStream the stream returned is empty. Am I doing something wrong? The Zip File isn't corrupted because I tried to unzip the files to my disk and it did it successfully.
@adamhathcock commented on GitHub (Sep 24, 2021):
Archives expect a random access stream. I don't know what HttpClient is doing with the response stream of that but it could not be buffered.
You should use Reader or buffer the stream yourself (to memory or a file) and see what happens.
Also, use async/await instead of .Result
@majorro commented on GitHub (Dec 11, 2024):
Same here,
ReadAsStreamreturnsMemoryStreambtw