Compress::Bzip2

High-level bindings to libbzip2

perl6-Compress-Bzip2

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.

Compress::Bzip2 v0.4.1

High-level bindings to libbzip2

Authors

    License

    Artistic-2.0

    Dependencies

    Compress::Bzip2::Raw

    Test Dependencies

    Provides

    • Compress::Bzip2

    The Camelia image is copyright 2009 by Larry Wall. "Raku" is trademark of the Yet Another Society. All rights reserved.