Skip to content
New issue

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

Not for zip packages? #45

Open
flaviu22 opened this issue Jan 30, 2024 · 0 comments
Open

Not for zip packages? #45

flaviu22 opened this issue Jan 30, 2024 · 0 comments

Comments

@flaviu22
Copy link

"C++ lib for gzip compression and decompression" means not for zip packages?
I have tried:

	std::string filename("c:/transfer/test.zip");
	std::ifstream ifs(filename, std::ios_base::in | std::ios_base::binary);
	if (ifs.is_open())
	{
		std::cout << "zip opened\n";
		std::string str_compressed((std::istreambuf_iterator<char>(ifs.rdbuf())), std::istreambuf_iterator<char>());
		ifs.close();
		std::string out{};
		gzip::Decompressor decomp{};
		try
		{
			decomp.decompress(out, str_compressed.data(), str_compressed.size());
			std::cout << out.c_str() << std::endl;
		}
		catch (std::exception& ex)
		{
			std::cout << ex.what() << std::endl;
		}
	}

But I got:
incorrect header check
So, gzip isn't for zip packages?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant