dart_native_compression 1.1.0+4 dart_native_compression: ^1.1.0+4 copied to clipboard
A dart binding to native compression libraries, including lz4@1.9.3.
Getting Started #
import 'dart:ffi';
import 'package:dart_native_compression/dart_native_compression.dart';
final lz4 = Lz4Lib(lib: DynamicLibrary.open('libnative_compression.so'));
print('LZ4 version number: ${lz4.getVersioinNumber()}');
To compress data into a lz4 frame
final compressedFrame = lz4.compressFrame(data);
To decompress a lz4 frame with a single function
final decompressed = lz4.decompressFrame(compressedFrame);
To decompress a lz4 frame with stream api
await for (final decompressedChunk
in lz4.decompressFrameStream(compressedStream)) {
// Your logic here
}
To get more examples #
Go to unit test