mirror of
https://github.com/ultimatepp/ultimatepp.git
synced 2026-06-03 06:12:43 -06:00
reorganizing repo
git-svn-id: svn://ultimatepp.org/upp/trunk@9206 f0d560ea-af0d-0410-9eb7-867de7ffcac7
This commit is contained in:
parent
7d17505cfe
commit
e3e8d627f5
3840 changed files with 0 additions and 1161578 deletions
|
|
@ -1,48 +0,0 @@
|
|||
#include <Core/Core.h>
|
||||
#include <plugin/lz4/lz4.h>
|
||||
|
||||
using namespace Upp;
|
||||
|
||||
CONSOLE_APP_MAIN
|
||||
{
|
||||
String h = "This is some line that is to be compressed";
|
||||
h << h;
|
||||
h << h;
|
||||
h << h;
|
||||
h << h;
|
||||
DUMP(h);
|
||||
String path = "c:/xxx/test.zc";
|
||||
|
||||
{
|
||||
FileOut fout(path);
|
||||
fout.Put("COMPRESSED");
|
||||
int64 pos = fout.GetPos();
|
||||
fout.Put64le(pos);
|
||||
Lz4 zlib;
|
||||
OutFilterStream out(fout, zlib);
|
||||
zlib.Compress();
|
||||
out % h;
|
||||
int ob = out.GetPos();
|
||||
out.Close();
|
||||
fout.Seek(pos);
|
||||
fout.Put64le(out.GetPos());
|
||||
}
|
||||
|
||||
{
|
||||
String h2;
|
||||
FileIn fin(path);
|
||||
if(fin.GetSize() < 14)
|
||||
return;
|
||||
String hdr = fin.Get(10);
|
||||
if(hdr != "COMPRESSED")
|
||||
return;
|
||||
int sz = fin.Get64le();
|
||||
DDUMP(sz);
|
||||
Lz4 zlib;
|
||||
InFilterStream in(fin, zlib);
|
||||
in.SetSize(sz);
|
||||
zlib.Decompress();
|
||||
in % h2;
|
||||
DUMP(h2);
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue