Added ZIP64 support. One can download whatever file(s)

This commit is contained in:
emeric
2020-09-17 14:26:20 +02:00
parent adfd43e82b
commit 12de97788f
4 changed files with 292 additions and 110 deletions
+6 -1
View File
@@ -61,15 +61,20 @@ int main(int argc, char* argv[])
{
Zipper zipper {files};
Zip::SizeType nbTotalWrittenBytes {};
while (!zipper.isComplete())
{
//std::array<std::byte, Zipper::minOutputBufferSize> buffer;
std::array<std::byte, 65536> buffer;
std::size_t nbWrittenBytes {zipper.writeSome(buffer.data(), buffer.size())};
const Zip::SizeType nbWrittenBytes {zipper.writeSome(buffer.data(), buffer.size())};
ofs.write(reinterpret_cast<const char*>(buffer.data()), nbWrittenBytes);
nbTotalWrittenBytes += nbWrittenBytes;
}
if (nbTotalWrittenBytes != zipper.getTotalZipFile())
std::cerr << "ERROR: actual size mismatch!" << std::endl;
std::cout << "Total zip size = " << zipper.getTotalZipFile() << std::endl;
}
catch (const ZipperException& e)