Gzip-RandomAccess
view release on metacpan or search on metacpan
lib/Gzip/RandomAccess.pm view on Meta::CPAN
cleanup => 1, # delete index when out of scope
);
# Extract 1024 bytes from the 128th byte in
print $gzip->extract(127, 1024), "\n";
=head1 DESCRIPTION
This module allows you to randomly access a gzip deflate stream
as if it were a regular file, even though gzip is not designed
to be random-access. This is achieved by streaming the gzip file
in advance, building an index mapping compressed byte offsets to
uncompressed offsets, and at each point storing the 32KB of data
gzip needs to prime its decompression engine from that point.
The mechanism is taken from zran.c, an example in the zlib
distribution; this module wraps it up in a nice XS Perl API and
provides index creation and cleanup mechanisms.
=head1 METHODS
( run in 0.231 second using v1.01-cache-2.11-cpan-4d50c553e7e )