Skip to content

Instantly share code, notes, and snippets.

@yannick
Created July 22, 2015 13:42
Show Gist options
  • Select an option

  • Save yannick/40f959e0e97d7bd0c626 to your computer and use it in GitHub Desktop.

Select an option

Save yannick/40f959e0e97d7bd0c626 to your computer and use it in GitHub Desktop.
import std.stdio;
import std.string;
import std.zlib;
void main(){
string bla = "VERYLONGSTRING";
auto comp = new Compress(HeaderFormat.gzip);
auto compressed = comp.compress(cast(byte[])bla);
compressed ~= comp.flush();
writeln(compressed);
writeln(compressed.length);
writeln("----");
UnCompress uncompressObj = new UnCompress();
string uncomp = cast(string)uncompressObj.uncompress(compressed);
writeln(uncomp);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment