mirror of
https://github.com/adamhathcock/sharpcompress.git
synced 2026-02-04 05:25:00 +00:00
GZipStream fails if whole file not read #467
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 @neumatho on GitHub (Jul 21, 2021).
I have the following simple code:
If only part of the file is read, the gz.Dispose() fails with either a "Destination too short" or "CRC checksum mismatch" exception. If the whole file is read, everything works fine.
The file to open, is a single file compressed with GZip. No archive.
@adamhathcock commented on GitHub (Aug 17, 2021):
This is how the current GZipStream works because it's trying to validate the data. An option to skip this could possibly be added.
If you don't want to read more, you can just copy the rest of the stream to Stream.Null