Compress::Bzip2(3pm)

πŸ’– Compress::Bzip2(3pm) β€” User Contributed Perl Documentation πŸ’–

okay so bestie, we're diving into Compress::Bzip2 and it's giving compression realness πŸ’…. Let's go.


🌸 NAME 🌸

Compress::Bzip2 β€” Interface to Bzip2 compression library


✨ SYNOPSIS ✨

here's the whole code vibe, no cap:

use Compress::Bzip2 qw(:all :constant :utilities :gzip);

($bz, $status) = bzdeflateInit( [PARAMS] );
($out, $status) = $bz->bzdeflate($buffer) ; # compress

($bz, $status) = bzinflateInit( [PARAMS] );
($out, $status) = $bz->bzinflate($buffer);  # uncompress

($out, $status) = $bz->bzflush() ;
($out, $status) = $bz->bzclose() ;

$dest = memBzip($source);
    alias compress
$dest = memBunzip($source);
    alias decompress

$bz = Compress::Bzip2->new( [PARAMS] );

$bz = bzopen($filename or filehandle, $mode);
    alternate, with $bz created by new():
$bz->bzopen($filename or filehandle, $mode);

$bytesread = $bz->bzread($buffer [,$size]) ;
$bytesread = $bz->bzreadline($line);
$byteswritten = $bz->bzwrite($buffer [,$limit]);
$errstring = $bz->bzerror();
$status = $bz->bzeof();
$status = $bz->bzflush();
$status = $bz->bzclose() ;

$status = $bz->bzsetparams( $param => $setting );

$bz->total_in() ;
$bz->total_out() ;

$verstring = $bz->bzversion();

$Compress::Bzip2::bzerrno

πŸ¦‹ DESCRIPTION πŸ¦‹

so like, the Compress::Bzip2 module provides a Perl interface to the bzip2 compression library (see "AUTHOR" for details about where to get Bzip2). A relevant subset of the functionality provided by bzip2 is available in Compress::Bzip2.

All string parameters can either be a scalar or a scalar reference. periodt. πŸ’…

The module can be split into two general areas of functionality, namely in-memory compression/decompression and read/write access to bzip2 files. Each of these areas will be discussed separately below.

NOTE

ngl, Compress::Bzip2 is just a simple bzip2 binding, comparable to the old Compress::Zlib library. It is not well integrated into PerlIO, use the preferred IO::Compress::Bzip2 instead.


🌈 FILE READ/WRITE INTERFACE 🌈

A number of functions are supplied in bzlib for reading and writing bzip2 files. Unfortunately, most of them are not suitable. So, this module provides another interface, built over top of the low level bzlib methods.

🌸 $bz = bzopen(filename or filehandle, mode)

This function returns an object which is used to access the other bzip2 methods.

The mode parameter is used to specify both whether the file is opened for reading or writing, with "r" or "w" respectively.

If a reference to an open filehandle is passed in place of the filename, it better be positioned to the start of a compression/decompression sequence.

WARNING: With Perl 5.6 you cannot use a filehandle because of SEGV in destruction with bzclose or an implicit close.

πŸŽ€ $bz = Compress::Bzip2->new( [PARAMS] )

Create a Compress::Bzip2 object. Optionally, provide compression/decompression parameters as a keyword => setting list. See bzsetparams() for a description of the parameters.

πŸ’… $bz->bzopen(filename or filehandle, mode)

This is bzopen, but it uses an object previously created by the new method. Other than that, it is identical to the above bzopen.

πŸ“ $bytesread = $bz->bzread($buffer [, $size]) ;

Reads $size bytes from the compressed file into $buffer. If $size is not specified, it will default to 4096. If the scalar $buffer is not large enough, it will be extended automatically.

Returns the number of bytes actually read. On EOF it returns 0 and in the case of an error, -1.

🧚 $bytesread = $bz->bzreadline($line) ;

Reads the next line from the compressed file into $line.

Returns the number of bytes actually read. On EOF it returns 0 and in the case of an error, -1.

It IS legal to intermix calls to bzread and bzreadline.

At this time bzreadline ignores the variable $/ ($INPUT_RECORD_SEPARATOR or $RS when "English" is in use). The end of a line is denoted by the C character '\n'.

πŸ’œ $byteswritten = $bz->bzwrite($buffer [, $limit]) ;

Writes the contents of $buffer to the compressed file. Returns the number of bytes actually written, or 0 on error.

If $limit is given and non-zero, then only that many bytes from $buffer will be written.

✨ $status = $bz->bzflush($flush) ;

Flushes all pending output to the compressed file. Works identically to the zlib function it interfaces to. Note that the use of bzflush can degrade compression.

Returns "BZ_OK" if $flush is "BZ_FINISH" and all output could be flushed. Otherwise the bzlib error code is returned.

Refer to the bzlib documentation for the valid values of $flush.

πŸ’– $status = $bz->bzeof() ;

Returns 1 if the end of file has been detected while reading the input file, otherwise returns 0.

πŸ¦‹ $bz->bzclose

Closes the compressed file. Any pending data is flushed to the file before it is closed.

🌟 $bz->bzsetparams( [PARAMS] );

Change settings for the deflate stream $bz.

The list of the valid options is shown below. Options not specified will remain unchanged.

  • -verbosity β€” Defines the verbosity level. Valid values are 0 through 4,

The default is "-verbosity => 0".

  • -blockSize100k β€” For bzip object opened for stream deflation or write.

Defines the buffering factor of compression method. The algorithm buffers all data until the buffer is full, then it flushes all the data out. Use -blockSize100k to specify the size of the buffer.

Valid settings are 1 through 9, representing a blocking in multiples of 100k.

Note that each such block has an overhead of leading and trailing synchronization bytes. bzip2 recovery uses this information to pull useable data out of a corrupted file.

A streaming application would probably want to set the blocking low.

  • -workFactor β€” For bzip object opened for stream deflation or write.

The workFactor setting tells the deflation algorithm how much work to invest to compensate for repetitive data.

workFactor may be a number from 0 to 250 inclusive. The default setting is 30.

See the bzip documentation for more information.

  • -small β€” For bzip object opened for stream inflation or read.

small may be 0 or 1. Set "small" to one to use a slower, less memory intensive algorithm.

πŸ’€ $bz->bzerror

Returns the bzlib error message or number for the last operation associated with $bz. The return value will be the bzlib error number when used in a numeric context and the bzlib error message when used in a string context. The bzlib error number constants, shown below, are available for use.

BZ_CONFIG_ERROR
BZ_DATA_ERROR
BZ_DATA_ERROR_MAGIC
BZ_FINISH
BZ_FINISH_OK
BZ_FLUSH
BZ_FLUSH_OK
BZ_IO_ERROR
BZ_MAX_UNUSED
BZ_MEM_ERROR
BZ_OK
BZ_OUTBUFF_FULL
BZ_PARAM_ERROR
BZ_RUN
BZ_RUN_OK
BZ_SEQUENCE_ERROR
BZ_STREAM_END
BZ_UNEXPECTED_EOF

🌈 $bz->bzclearerr

🌈 $bzerrno

The $bzerrno scalar holds the error code associated with the most recent bzip2 routine. Note that unlike bzerror(), the error is not associated with a particular file.

As with bzerror() it returns an error number in numeric context and an error message in string context. Unlike bzerror() though, the error message will correspond to the bzlib message when the error is associated with bzlib itself, or the UNIX error message when it is not (i.e. bzlib returned "Z_ERRORNO").

As there is an overlap between the error numbers used by bzlib and UNIX, $bzerrno should only be used to check for the presence of an error in numeric context. Use bzerror() to check for specific bzlib errors. The bzcat example below shows how the variable can be used safely.

🌸 $bz->prefix

Returns the additional 5 byte header which is prepended to the bzip2 header starting with "BZh" when using memBzip/compress.


✨ Compress::Bzip2 Utilities ✨

Options: -d -c -z -f -v -k -s -1..9

  • bzip2( [OPTS], filename)
  • bunzip2(filename)
  • bzcat(filenames...)
  • bzlibversion()
  • bzinflateInit( opts... )

🧚 Internal Utilties 🧚

bz_seterror(errno, msg) =head2 $bz->is_read() =head2 $bz->is_stream() =head2
    $bz->is_write() =head2 $bz->total_in() =head2 $bz->total_out() =head2
    version()

πŸ’œ Compress::Bzip2 1.03 COMPATIBILITY πŸ’œ

While the 2.x thread forked off of 1.00, another line of development came to a head at 1.03. The 1.03 version worked with bzlib 1.0.2, had improvements to the error handling, single buffer inflate/deflate, a streaming interface to inflate/deflate, and a cpan style test suite.

πŸŽ€ $dest = compress( $string, [$level] )

Alias to memBzip, this compresses string, using the optional compression level, 1 through 9, the default being 6. Returns a string containing the compressed data.

On error undef is returned.

πŸŽ€ $dest = decompress($string, [$level])

Alias to memBunzip, this decompresses the data in string, returning a string containing the decompressed data.

On error undef is returned.

πŸŽ€ uncompress($string, [$level])

Another alias to memBunzip

πŸŽ€ $stream = compress_init( [PARAMS] )

Alias to bzdeflateInit. In addition to the named parameters documented for bzdeflateInit, the following are accepted:

-level, alias to -blockSize100k
-buffer, to set the buffer size.

The -buffer option is ignored. The intermediate buffer size is not changeable.

πŸŽ€ $stream = decompress_init( [PARAMS] )

Alias to bzinflateInit. See bzinflateInit for a description of the parameters. The option "-buffer" is accepted, but ignored.

πŸŽ€ $output = $stream->add( $string )

Add data to be compressed/decompressed. Returns whatever output is available (possibly none, if it's still buffering it), or undef on error.

πŸŽ€ $output = $stream->finish( [$string] )

Finish the operation; takes an optional final data string. Whatever is returned completes the output; returns undef on error.

πŸŽ€ $stream->error

Like the function, but applies to the current object only. Note that errors in a stream object are also returned by the function.

πŸŽ€ $stream->input_size

Alias to total_in. Total bytes passed to the stream.

πŸŽ€ $stream->output_size

Alias to total_out. Total bytes received from the stream.

let's talk gzip compat, bestie 🫢 β€” GZIP COMPATIBILITY INTERFACE

Okay so real talk: this package basically shows up wearing the same outfit as Compress::Zlib, except for the exact state and error numbers. That's the whole vibe. Like, if you take a method name, a state, or an error number from Compress::Zlib and swap the "g" for a "b", your code should Just Work. No cap.

And to make interop even more of a slay, every single Compress::Zlib method name has been set up as an alias or cover function for the bzip2 methods. Literally all of them. πŸ™ˆ

So most code that uses Compress::Zlib should be able to use this package with a one line change. One. Line. Periodt.

Simply change this:

$gz = Compress::Zlib::gzopen( "filename", "w" );

to this:

$gz = Compress::Bzip2::gzopen( "filename", "w" );

And that's it, you're done, iconic behavior. πŸŽ€

Heads up though: some of the Compress::Zlib aliases don't return anything useful β€” like crc32 or adler32 β€” because bzip2 simply doesn't do that sort of thing. It's giving "I don't have that feature and I refuse to fake it." πŸ’…


$gz = gzopen( $filename, $mode )

Alias for bzopen. Matching energy, different letter.

$gz->gzread( $buffer, [ $length ] )

Alias for bzread.

$gz->gzreadline( $buffer )

Alias for bzreadline.

$gz->gzwrite( $buffer )

Alias for bzwrite.

$gz->gzflush( [$flushtype] )

Alias for bzflush, but it does a little return code translation on the way out. ✨

$gz->gzclose( )

Alias for bzclose.

$gz->gzeof( )

Alias for bzeof.

$gz->gzerror( )

Alias for bzerror.

$gz->gzsetparams( $level, $strategy )

This one is a no-op. It literally does nothing and simply exists to keep your code from crying. 😭

$d = deflateInit( [OPTS] )

Alias for bzdeflateInit, with return code translation.

All OPTS are ignored. Yeah, all of them. It's giving "I heard you, I just don't care." πŸ™ˆ

$d->deflate( $buffer )

Alias for bzdeflate, with return code translation.

$d->deflateParams( [OPTS] )

This is a no-op.

$d->flush( [$flushtype] )

Cover function for bzflush or bzclose, depending on what $flushtype is set to.

See the Compress::Zlib documentation for more information. (Bestie I'm not rewriting that one, go read it, it's fiiiine.)

$d->dict_adler( )

This is a no-op.

$d->msg( )

This is a no-op.

$d = inflateInit( [OPTS] )

Alias for bzinflateInit, with return code translation.

All OPTS are ignored. Again. Same energy. πŸ’€

$d->inflate( )

Alias for bzinflate, with return code translation.

$d->inflateSync( )

This is a no-op.

$d->adler32( $crc )

This is a no-op.

$d->crc32( $crc )

This is a no-op.

$buffer = memGzip( $buffer )

Alias for memBzip.

$buffer = memGunzip( $buffer )

Alias for memBunzip.


πŸ’– IN-MEMORY COMPRESS/UNCOMPRESS πŸ’–

So bzlib ships two high-level functions for doing compression right there in memory, no files involved: memBzip and memBunzip. And this package gives you two Perl subs that do the same kind of thing. We love a matching set. πŸŽ€

$compressed = memBzip($buffer);

Compresses $buffer. If it works out, you get the compressed data back. Otherwise you get undef. That's the whole deal.

The buffer parameter can either be a scalar or a scalar reference. Both work, pick your fighter. ✨

Essentially, an in-memory bzip file gets created. It builds a minimal bzip header, which adds 5 bytes before the bzip2 specific BZh header. Yeah, 5 whole bytes, just vibing at the front. πŸ¦‹

$uncompressed = memBunzip($buffer);

Uncompresses $buffer. If it works out, you get the uncompressed data back. Otherwise you get undef.

The source buffer can either be a scalar or a scalar reference.

The buffer parameter can either be a scalar or a scalar reference. The contents of the buffer parameter are destroyed after calling this function. Like, gone. Poof. So don't come back looking for them. 😭


🌈 STREAM DEFLATE (= COMPRESS) 🌈

Real talk about the Perl interface: it will always consume the complete input buffer before returning. No partial reads, no crumbs left behind. Also the output buffer it hands you will automatically grow to fit however much output is available. It's self-adjusting, it's thriving, it's main character energy. πŸ‘‘

Here's the interface laid out for you:

($d, $status) = bzdeflateInit( [PARAMS] )

Initialises a deflation stream. Let's go.

If it succeeds, you get the initialised deflation stream $d and a $status of "BZ_OK" in a list context. In scalar context it returns just the deflation stream, $d, only.

If it does not succeed, the returned deflation stream ($d) will be undef and $status will hold the exact bzip2 error code. Exact. It tells you everything. πŸ’…

The function optionally takes a number of named options specified as -Name=>value pairs. This lets you tailor individual options without having to specify all of them in the parameter list. Mix and match, bestie.

Here's the list of valid options:

-verbosity

Defines the verbosity level. Valid values are 0 through 4,

The default is -verbosity => 0.

-blockSize100k

Defines the buffering factor of the compression method. The algorithm buffers all data until the buffer is full, then it flushes all the data out. Use -blockSize100k to specify the size of that buffer.

Valid settings are 1 through 9, representing a blocking in multiples of 100k.

Note that each such block has an overhead of leading and trailing synchronization bytes. bzip2 recovery uses this information to pull useable data out of a corrupted file. So those extra bytes are literally doing hero work. 🫢

A streaming application would probably want to set the blocking low.

-workFactor

The workFactor setting tells the deflation algorithm how much work to invest to compensate for repetitive data. Like, how hard should it try? That's this knob.

workFactor may be a number from 0 to 250 inclusive. The default setting is 30.

See the bzip documentation for more information.

Here's an example of using the deflateInit optional parameter list to override the default buffer size and compression level. All other options will take their default values.

bzdeflateInit( -blockSize100k => 1, -verbosity => 1 );

($out, $status) = $d->bzdeflate($buffer)

Deflates the contents of $buffer. The buffer can either be a scalar or a scalar reference. When finished, $buffer will be completely processed (assuming there were no errors, obviously). If the deflation was successful it returns deflated output, $out, and a status value, $status, of "Z_OK".

On error, $out will be undef and $status will contain the zlib error code.

In a scalar context bzdeflate will return $out only.

As with the internal buffering of the deflate function in bzip2, it is not necessarily the case that any output will be produced by this method. So don't rely on the fact that $out is empty for an error test β€” empty output does not mean broken, it means "chill, the buffer's still holding it." πŸ™ˆ In fact, given the size of bzdeflate's internal buffer, with most files it's likely you won't see any output at all until flush or close. That's normal. Don't panic.

($out, $status) = $d->bzflush([flush_type])

Typically used to finish the deflation. Any pending output will be returned via $out. $status will have a value "BZ_OK" if successful.

In a scalar context bzflush will return $out only.

Note that flushing can seriously degrade the compression ratio, so it should only be used to terminate a decompression (using "BZ_FLUSH") or when you want to create a full flush point (using "BZ_FINISH"). This is not a "just do it whenever" situation, bestie. 😭

The allowable values for flush_type are "BZ_FLUSH" and "BZ_FINISH".

For a handle opened for "w" (bzwrite), the default is "BZ_FLUSH". For a stream, the default for flush_type is "BZ_FINISH" (which is essentially a close and reopen).

It is strongly recommended that you only set the flush_type parameter if you fully understand the implications of what it does. See the bzip2 documentation for details. Fr fr. Don't just yolo this one. πŸ’€

Example

Here's a trivial little example of using bzdeflate. It simply reads standard input, deflates it and writes it to standard output. Nothing fancy, just a cute pipeline moment. ✨

use strict ;
use warnings ;

use Compress::Bzip2 ;

binmode STDIN;
binmode STDOUT;
my $x = bzdeflateInit()
   or die "Cannot create a deflation stream\n" ;

my ($output, $status) ;
while (<>)
{
    ($output, $status) = $x->bzdeflate($_) ;

    $status == BZ_OK
        or die "deflation failed\n" ;

    print $output ;
}

($output, $status) = $x->bzclose() ;

$status == BZ_OK
    or die "deflation failed\n" ;

print $output ;

πŸ¦‹ STREAM INFLATE πŸ¦‹

And now the other direction. Here is a definition of the interface:

($i, $status) = inflateInit()

Initialises an inflation stream.

In a list context it returns the inflation stream, $i, and the zlib status code ($status). In a scalar context it returns the inflation stream only.

If successful, $i will hold the inflation stream and $status will be "BZ_OK".

If not successful, $i will be undef and $status will hold the bzlib.h error code. It's giving receipts. 🧾

The function optionally takes a number of named options specified as -Name=>value pairs. This allows individual options to be tailored without having to specify them all in the parameter list.

For backward compatibility, it is also possible to pass the parameters as a reference to a hash containing the name=>value pairs. Old school, but valid, we respect it. 🫢

The function takes one optional parameter, a reference to a hash. The contents of the hash allow the deflation interface to be tailored.

Here's the list of valid options:

-small

small may be 0 or 1. Set small to one to use a slower, less memory intensive algorithm. Slower but it sips RAM instead of inhaling it. πŸ“

-verbosity

Defines the verbosity level. Valid values are 0 through 4,

The default is -verbosity => 0.

Here's an example of using the bzinflateInit optional parameter.

bzinflateInit( -small => 1, -verbosity => 1 );

($out, $status) = $i->bzinflate($buffer)

Inflates the complete contents of $buffer. The buffer can either be a scalar or a scalar reference.

Returns "BZ_OK" if successful and "BZ_STREAM_END" if the end of the compressed data has been successfully reached. If not successful, $out will be undef and $status will hold the bzlib error code.

Heads up: the $buffer parameter is modified by bzinflate. On completion it will contain what remains of the input buffer after inflation. So when the return status is "BZ_OK", $buffer will be an empty string. And when the return status is "BZ_STREAM_END", the $buffer parameter will contain what (if anything) was stored in the input buffer after the deflated data stream. It's literally editing your variable in place, like a friend who "borrows" your hoodie. πŸ™ˆ

This feature is useful when processing a file format that encapsulates a compressed data stream. iykyk. πŸ’…

Example

Here's an example of using bzinflate.

use strict ;
use warnings ;

use Compress::Bzip2;

my $x = bzinflateInit()
   or die "Cannot create a inflation stream\n" ;

my $input = '' ;
binmode STDIN;
binmode STDOUT;

my ($output, $status) ;
while (read(STDIN, $input, 4096))
{
    ($output, $status) = $x->bzinflate(\$input) ;

    print $output
        if $status == BZ_OK or $status == BZ_STREAM_END ;

    last if $status != BZ_OK ;
}

die "inflation failed\n"
    unless $status == BZ_STREAM_END ;

πŸ’– EXAMPLES πŸ’–

okay bestie, here's where it gets fun β€” actual scripts you can steal. These are real examples of using the interface, no cap. 🫢

🌸 A bzcat function 🌸

use strict ;
use warnings ;

use Compress::Bzip2 ;

die "Usage: bzcat file...\n" unless @ARGV ;

my $file ;

foreach $file (@ARGV) {
  my $buffer ;

  my $bz = bzopen($file, "rb")
     or die "Cannot open $file: $bzerrno\n" ;

  print $buffer while $bz->bzread($buffer) > 0 ;

  die "Error reading from $file: $bzerrno" . ($bzerrno+0) . "\n"
     if $bzerrno != BZ_STREAM_END ;

  $bz->bzclose() ;
}

it's giving unbothered. opens each file, slurps it out in chunks with bzread, prints, checks the error, closes. periodt. ✨

🌸 A grep using bzreadline 🌸

use strict ;
use warnings ;

use Compress::Bzip2 ;

die "Usage: bzgrep pattern file...\n" unless @ARGV >= 2;

my $pattern = shift ;

my $file ;

foreach $file (@ARGV) {
  my $bz = bzopen($file, "rb")
     or die "Cannot open $file: $bzerrno\n" ;

  while ($bz->bzreadline($_) > 0) {
    print if /$pattern/ ;
  }

  die "Error reading from $file: $bzerrno\n"
    if $bzerrno != Z_STREAM_END ;

  $bz->bzclose() ;
}

same energy, but it's a grep. pattern gets shifted off, then every matching line goes straight to your terminal. the way that bzreadline just… exists? iconic. πŸ’…

πŸ¦‹ Streaming Compression πŸ¦‹

This script, bzstream, does the opposite of the bzcat script above. It reads from standard input and writes a bzip file to standard output. πŸ”₯

use strict ;
use warnings ;

use Compress::Bzip2 ;

binmode STDOUT;       # bzopen only sets it on the fd

my $bz = bzopen(\*STDOUT, "wb")
   or die "Cannot open stdout: $bzerrno\n" ;

while (<>) {
  $bz->bzwrite($_) or die "error writing: $bzerrno\n" ;
}

$bz->bzclose ;
note the binmode STDOUT; line up there β€” bzopen only sets it on the fd, bestie. don't skip it. πŸ™ˆ

πŸ’œ EXPORT πŸ’œ

Use the tags :all, :utilities, :constants, :bzip1 and :gzip.

πŸŽ€ Export tag :all πŸŽ€

This exports all the exportable methods. literally everything. the whole closet. πŸ‘‘

πŸŽ€ Export tag :constants πŸŽ€

This exports only the BZ_* constants.

πŸŽ€ Export tag :bzip1 πŸŽ€

This exports the Compress::Bzip2 1.x functions, for compatibility. nostalgic fr fr. 🌈

compress
decompress
compress_init
decompress_init
version

These are actually aliases to memBzip and memBunzip.

πŸŽ€ Export tag :utilities πŸŽ€

This gives an interface to the bzip2 methods. πŸ› οΈβœ¨

bzopen
bzinflateInit
bzdeflateInit
memBzip
memBunzip
bzip2
bunzip2
bzcat
bzlibversion
$bzerrno

πŸŽ€ Export tag :gzip πŸŽ€

This gives compatibility with Compress::Zlib. bestie crossover episode. πŸ’«

gzopen
gzinflateInit
gzdeflateInit
memGzip
memGunzip
$gzerrno

🌟 Exportable constants 🌟

All the bzlib constants are automatically imported when you make use of Compress::Bzip2.

BZ_CONFIG_ERROR
BZ_DATA_ERROR
BZ_DATA_ERROR_MAGIC
BZ_FINISH
BZ_FINISH_OK
BZ_FLUSH
BZ_FLUSH_OK
BZ_IO_ERROR
BZ_MAX_UNUSED
BZ_MEM_ERROR
BZ_OK
BZ_OUTBUFF_FULL
BZ_PARAM_ERROR
BZ_RUN
BZ_RUN_OK
BZ_SEQUENCE_ERROR
BZ_STREAM_END
BZ_UNEXPECTED_EOF

🌈 SEE ALSO 🌈

The documentation for zlib, bzip2 and Compress::Zlib. go read those too, bestie, they're lowkey iconic. πŸ“šπŸ’–


πŸ‘‘ AUTHOR πŸ‘‘

Rob Janes, <arjay at cpan.org>


Copyright (C) 2005 by Rob Janes

This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself, either Perl version 5.8.3 or, at your option, any later version of Perl 5 you may have available.


πŸ‘‘ AUTHOR πŸ‘‘ (the origin story, like a prequel 🎬)

The Compress::Bzip2 module was originally written by Gawdi Azem azemgi@rupert.informatik.uni-stuttgart.de.

The first Compress::Bzip2 module was written by Gawdi Azem azemgi@rupert.informatik.uni-stuttgart.de. It provided an interface to the in memory inflate and deflate routines.

Compress::Bzip2 was subsequently passed on to Marco Carnut kiko@tempest.com.br who shepherded it through to version 1.03, a set of changes which included upgrades to handle bzlib 1.0.2, and improvements to the in memory inflate and deflate routines. The streaming interface and error information were added by David Robins dbrobins@davidrobins.net.

Version 2 of Compress::Bzip2 is due to Rob Janes, of arjay@cpan.org. This release is intended to give an interface close to that of Compress::Zlib. It's development forks from 1.00, not 1.03, so the streaming interface is not the same as that in 1.03, although apparently compatible as it passes the 1.03 test suite.

Minor subsequent fixes and releases were done by Reini Urban, rurban@cpan.org.


πŸ¦‹ MODIFICATION HISTORY πŸ¦‹

See the Changes file.

2.00 Second public release of Compress::Bzip2.


and that's a wrap, bestie!! πŸŽ€βœ¨ the source is perl v5.42.3, dated 2026-08-19, and this whole gorgeous thing is Compress::Bzip2(3pm). go compress something. no cap. πŸ’–πŸ«ΆπŸ’…

πŸ“¦ where this page comes from