We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
I would like to merge two zip files without decompressing/recompressing and decrypting/encrypting.
The following spike code does what I want:
var addEntryMethod = typeof(ZipFile).GetMethod("InternalAddEntry", BindingFlags.NonPublic | BindingFlags.Instance);
using (var zip1 = ZipFile.Read(stream1)) using (var zip2 = ZipFile.Read(stream2)) { foreach (var entry in zip2.ToArray()) { entry.FileName = $@"zip2/{entry.FileName}"; addEntryMethod.Invoke(zip1, new object[] { entry.FileName, entry }); //zip1.InternalAddEntry(entry.FileName, entry); }
zip1.Save(@"C:\temp\merged.zip");
}
The text was updated successfully, but these errors were encountered:
No branches or pull requests
I would like to merge two zip files without decompressing/recompressing and decrypting/encrypting.
The following spike code does what I want:
var addEntryMethod = typeof(ZipFile).GetMethod("InternalAddEntry", BindingFlags.NonPublic | BindingFlags.Instance);
using (var zip1 = ZipFile.Read(stream1))
using (var zip2 = ZipFile.Read(stream2))
{
foreach (var entry in zip2.ToArray())
{
entry.FileName = $@"zip2/{entry.FileName}";
addEntryMethod.Invoke(zip1, new object[] { entry.FileName, entry });
//zip1.InternalAddEntry(entry.FileName, entry);
}
}
The text was updated successfully, but these errors were encountered: