I suppose the best option would be to introduce a flag VerifyChecksum (or SkipChecksumCheck) within ArchiveLoadOptions class. Default value will be true, but you can load your archive with intentional skip of CRC verification. However, if algorithm fails to extract due to data corruption you’ll get another exception. Here is the usage scenario in .NET:
using (var archive = new Archive(fs, new ArchiveLoadOptions() { VerifyChecksum = false }))
{
using (Stream decompressed = archive.Entries[0].Open())
{
byte[] buffer = new byte[4096];
int bytesRead;
while ((bytesRead = decompressed.Read(buffer, 0, buffer.Length)) > 0)
{
destination.Write(buffer, 0, bytesRead);
}
}
}
What do you think on such an approach?
Entries are being extracted independently from each other. Above is the sample of extracting a single entry.
I think it’s good. The only thing is that I would make that option similar to the password, so I can pass it as you did in the general ArchiveLoadOptions, but I could also “overwrite it” when opening a single file, to make it more granular
Unlikely we’ll provide such a granularity. There is Extract method with two arguments, expand it with one more even optional argument is too much.
However it is feasible to provide an event OnChecksumVerificationFailed or similar. This event, if agreed, is not for the upcoming version.
Sets consent for sending user data to Google for online advertising purposes.
Sets consent for personalized advertising.
Cookie Notice
To provide you with the best experience, we use cookies for personalization, analytics, and ads. By using our site, you agree to our cookie policy.
More info
Enables storage, such as cookies, related to analytics.
Enables storage, such as cookies, related to advertising.
Sets consent for sending user data to Google for online advertising purposes.
Sets consent for personalized advertising.
Cookie Notice
To provide you with the best experience, we use cookies for personalization, analytics, and ads. By using our site, you agree to our cookie policy.
More info
Enables storage, such as cookies, related to analytics.
Enables storage, such as cookies, related to advertising.
Sets consent for sending user data to Google for online advertising purposes.