High-level bzip2 bindings for perl6
Perl6
Switch branches/tags
Nothing to show
Latest commit f8cd905 Mar 15, 2017 @Altai-man Add tags
Permalink
Failed to load latest commit information.
lib/Compress Usage of a type instead of the pointer-type variable Aug 8, 2016
t Support of stream class. Jan 19, 2016
.travis.yml Adding of dependency. Jan 15, 2016
LICENSE Init Jan 12, 2016
META6.json Add tags Mar 15, 2017
README.md Support of stream class. Jan 19, 2016

README.md

perl6-Compress-Bzip2 Build Status

Bindings to bzip2 library. Procedural API is as easy as pie: you can compress and decompress your files like this:

compress($filename);
decompress($filename);

If you want to make a simple "from Buf to Buf" (de)compressing, you should use something like this:

my buf8 $result = compressToBlob($data); # Data should be encoded.
# or
my Str $result = decompressToBlob($compressed-data).decode;

Also, now we support streaming:

my $compressor = Compress::Bzip2::Stream.new;
loop {
     $socket.write($compressor.compress($data-chunk));
}
$socket.write($compressor.finish);

my $dcompressor = Compress::Bzip2::Stream.new;
while !$dcompressor.finished {
      my $data-chunk = $dcompressor.decompress($socked.read($size));
}

Your any suggestions, reporting of issues and advices about design of library will be really helpful.

I'm very grateful to authors of perl6 bindings to zlib compression library, since I took their code as example for this work and wrote very similar interface.

TODO

  • Docs.