Compress-Raw-Lzma

 view release on metacpan or  search on metacpan

lib/Compress/Raw/Lzma.pm  view on Meta::CPAN

    use Compress::Raw::Lzma;

    # Combine filters for maximum compression
    my @filters = (
        Lzma::Filter::Delta(Distance => 1),
        Lzma::Filter::Lzma2(
            DictSize => 64 * 1024 * 1024,  # 64 MB
            Lc => 4,
            Lp => 0,
            Pb => 2,
            Mode => LZMA_MODE_NORMAL,
            Nice => 273,
            Mf => LZMA_MF_BT4,
            Depth => 1024,
        ),
    );

    my ($lz, $status) = Compress::Raw::Lzma::StreamEncoder->new(
        Filter => \@filters,
        Check => LZMA_CHECK_SHA256,
    );
    die "Cannot create encoder: $status\n" unless $lz;

=head1 Misc

=head2 my $version = Compress::Raw::Lzma::lzma_version_number();

Returns the version of the underlying lzma library this module is using at
run-time as a number.

=head2 my $version = Compress::Raw::Lzma::lzma_version_string();

Returns the version of the underlying lzma library this module is using at
run-time as a string.

=head2 my $version = Compress::Raw::Lzma::LZMA_VERSION();

Returns the version of the underlying lzma library this module was using at
compile-time as a number.

=head2 my $version = Compress::Raw::Lzma::LZMA_VERSION_STRING();

Returns the version of the underlying lzma library this module was using at
compile-time as a string.

=head1 Constants

The following lzma constants are exported by this module.

=head2 Return/Status Codes

=over 5

=item LZMA_OK

Operation completed successfully.

=item LZMA_STREAM_END

End of stream was reached. The complete compressed data has been
decoded/encoded.

=item LZMA_NO_CHECK

Input stream has no integrity check.

=item LZMA_UNSUPPORTED_CHECK

Cannot calculate the integrity check (not supported by this build).

=item LZMA_GET_CHECK

Integrity check type is now available.

=item LZMA_MEM_ERROR

Cannot allocate memory.

=item LZMA_MEMLIMIT_ERROR

Memory usage limit was reached.

=item LZMA_FORMAT_ERROR

File format not recognized.

=item LZMA_OPTIONS_ERROR

Invalid or unsupported options.

=item LZMA_DATA_ERROR

Data is corrupt.

=item LZMA_BUF_ERROR

No progress is possible (stream is truncated or corrupt).

=item LZMA_PROG_ERROR

Programming error (should never happen in correct usage).

=back

=head2 Flush Modes

=over 5

=item LZMA_RUN

Continue coding. Used for normal operation.

=item LZMA_SYNC_FLUSH

Make all the input available at output. Not commonly used with LZMA.

=item LZMA_FULL_FLUSH

Finish encoding of the current Block. Not commonly used.

=item LZMA_FINISH



( run in 0.772 second using v1.01-cache-2.11-cpan-6aa56a78535 )