lzma 0.3.0

  • README.md
  • CHANGELOG.md
  • Installing
  • Versions
  • 66

dart-lzma is a port of LZMA compression algorithm to Dart.

The source code is a manual translation from the original Java version found on the LZMA SDK.

How to use it?

If you want to compress data then just call to the compress function:

import "package:lzma/lzma.dart" as LZMA;

var input = new LZMA.InStream(<PUT YOUR DATA BUFFER HERE>);
var output = new LZMA.OutStream();
LZMA.compress(input, output);

//output.data has now your compressed data

If you want to decompress data then just call to the decompress function:

import "package:lzma/lzma.dart" as LZMA;

var input = new LZMA.InStream(<PUT YOUR LZMA DATA BUFFER HERE>);
var output = new LZMA.OutStream();
LZMA.decompress(input, output);

//output.data has now your uncompressed data

Where:

  • input is the input data stream
  • output is the output data stream

Streams

Current stream classes will be change in the future.

Examples

Compress a file and write the result to another one:

import "dart:io";
import "package:lzma/lzma.dart" as LZMA;

void main(List<String> args) {
  if (args.length != 2) {
    print("Usage: compress input output");
    return;
  }

  var inFile = new File(args[0]);
  var outFile = new File(args[1]);

  var input = new LZMA.InStream(inFile.readAsBytesSync());
  var output = new LZMA.OutStream();

  LZMA.compress(input, output);

  outFile.writeAsBytesSync(output.data);
}

Decompress a file and write the result to another one:

import "dart:io";
import "package:lzma/lzma.dart" as LZMA;

void main(List<String> args) {
  if (args.length != 2) {
    print("Usage: decompress input output");
    return;
  }

  var inFile = new File(args[0]);
  var outFile = new File(args[1]);

  var input = new LZMA.InStream(inFile.readAsBytesSync());
  var output = new LZMA.OutStream();

  LZMA.decompress(input, output);

  outFile.writeAsBytesSync(output.data);
}

Performance

Be sure to run the library in production mode (not checked mode) with debugging disabled.

Limitations

  • Output data size is limited to 32 bits.

0.3.0 - Jan 25, 2014

  • Updated README.md, LICENSE.txt and CHANGELOG.md

0.2.1 - Nov 09, 2013

  • Updated README.md

0.2.0 - Nov 08, 2013

  • Added List<String> args to main function, Options class was removed from SDK
  • Used fixnum package from pub, removed local package
  • Fixed sublist parameters, now end is exclusive
  • Removed annoying "There is no such operator '>>' in num" warning
  • Ready for Dart 1.0.0!

0.1.3 - Mar 25, 2013

  • Updated fixnum library
  • Removed deprecated List.fixedLength constructor
  • Changed List.getRange for sublist

0.1.2 - Feb 01, 2013

  • Pre-M3 update

0.1.1 - Jan 18, 2013

  • Fixed some README.md tags
  • Added licenses directory
  • Added CHANGES.md

0.1.0 - Jan 17, 2013

  • First Dart pub package release

1. Depend on it

Add this to your package's pubspec.yaml file:


dependencies:
  lzma: "^0.3.0"

2. Install it

You can install packages from the command line:

with pub:


$ pub get

with Flutter:


$ flutter packages get

Alternatively, your editor might support pub get or packages get. Check the docs for your editor to learn more.

3. Import it

Now in your Dart code, you can use:


import 'package:lzma/lzma.dart';
        
Version Uploaded Documentation Archive
0.3.0 Jan 25, 2014 Go to the documentation of lzma 0.3.0 Download lzma 0.3.0 archive
0.2.1 Nov 8, 2013 Go to the documentation of lzma 0.2.1 Download lzma 0.2.1 archive
0.2.0 Nov 8, 2013 Go to the documentation of lzma 0.2.0 Download lzma 0.2.0 archive
0.1.3 Mar 25, 2013 Go to the documentation of lzma 0.1.3 Download lzma 0.1.3 archive
0.1.2 Feb 1, 2013 Go to the documentation of lzma 0.1.2 Download lzma 0.1.2 archive
0.1.1 Jan 18, 2013 Go to the documentation of lzma 0.1.1 Download lzma 0.1.1 archive
0.1.0 Jan 17, 2013 Go to the documentation of lzma 0.1.0 Download lzma 0.1.0 archive

Analysis

This feature is new.
We welcome feedback.
More details: scoring.

We analyzed this package, and provided a score, details, and suggestions below.

  • completed on Jan 21, 2018
  • Dart: 2.0.0-dev.15.0
  • pana: 0.10.0

Scores

Popularity:
Describes how popular the package is relative to other packages. [more]
73 / 100
Health:
Code health derived from static analysis. [more]
100 / 100
Maintenance:
Reflects how tidy and up-to-date the package is. [more]
0 / 100
Overall score:
Weighted score of the above. [more]
66

Platforms

Detected platforms: Flutter, web, other

No platform restriction found in primary library package:lzma/lzma.dart.

Suggestions

  • Use constrained dependencies.

    The pubspec.yaml contains 1 dependency without version constraints. Specify version ranges for the following dependencies: fixnum.

  • The description is too short.

    Add more detail about the package, what it does and what is its target use case. Try to write at least 60 characters.

  • Package is pre-v1 release.

    While there is nothing inherently wrong with versions of 0.*.*, it usually means that the author is still experimenting with the general direction API.

  • Maintain an example.

    None of the files in your example/ directory matches a known example patterns. Common file name patterns include: main.dart, example.dart or you could also use lzma.dart.

Dependencies

Package Constraint Resolved Available
Direct dependencies
Dart SDK >=1.1.1
fixnum >=0.9.0 0.10.6