Overview
Examples
Screenshots
Comparisons
Applications
Download
Documentation
Tutorials
Bazaar
Status & Roadmap
FAQ
Authors & License
Forums
Funding Ultimate++
Search on this site
Search in forums












SourceForge.net Logo
Home » U++ Library support » U++ Core » Zlib problem
Re: Zlib problem [message #51467 is a reply to message #51466] Thu, 28 March 2019 17:50 Go to previous message
Novo is currently offline  Novo
Messages: 1430
Registered: December 2006
Ultimate Contributor
Below is a fixed version which works in both Release and Debug configurations.

#include <Core/Core.h>
#include <plugin/lz4/lz4.h>
#include <plugin/zstd/zstd.h>

using namespace Upp;

CONSOLE_APP_MAIN
{
	StdLogSetup(LOG_FILE|LOG_COUT);

	String cpath = GetHomeDirFile("test");
	
	{
		FileOut out(cpath);
		ZCompressStream z(out);
		z.Put("Compressed by zlib");
	}
	
	{
		FileIn in(cpath);
		ZDecompressStream z(in);
		RLOG(z.GetLine());
	}

	{
		FileOut out(cpath);
		LZ4CompressStream z(out);
		z.Put("Compressed by LZ4");
	}
	
	{
		FileIn in(cpath);
		LZ4DecompressStream z(in);
		RLOG(z.GetLine());
	}

	{
		FileOut out(cpath);
		ZstdCompressStream z(out);
		z.Put("Compressed by Zstd");
	}
	
	{
		FileIn in(cpath);
		ZstdDecompressStream z(in);
		RLOG(z.GetLine());
	}
	
	FileDelete(cpath);
}


Regards,
Novo

[Updated on: Thu, 28 March 2019 17:50]

Report message to a moderator

 
Read Message
Read Message
Read Message
Previous Topic: [SOLVED] Purpose of HttpRequest::SSLCertificate
Next Topic: Some modifications for WebSocket as Server with SSL Support
Goto Forum:
  


Current Time: Tue Jun 10 23:22:25 CEST 2025

Total time taken to generate the page: 0.04151 seconds