https://github.com/butlermatt/msgpack2
Dart 1.x and 2.x implementation of MessagePack
https://github.com/butlermatt/msgpack2
dart dartlang messagepack msgpack
Last synced: about 2 months ago
JSON representation
Dart 1.x and 2.x implementation of MessagePack
- Host: GitHub
- URL: https://github.com/butlermatt/msgpack2
- Owner: butlermatt
- License: other
- Created: 2018-09-13T14:16:20.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2019-01-22T17:40:10.000Z (over 6 years ago)
- Last Synced: 2025-03-27T01:48:07.119Z (2 months ago)
- Topics: dart, dartlang, messagepack, msgpack
- Language: Dart
- Size: 41 KB
- Stars: 12
- Watchers: 1
- Forks: 7
- Open Issues: 6
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE.md
Awesome Lists containing this project
README
# MsgPack for Dart
[](https://travis-ci.org/butlermatt/msgpack2)A full-featured MsgPack library for Dart 1.x and 2.x.
## Attribution
This package was originally forked from [msgpack](https://pub.dartlang.org/packages/msgpack). Due to the number of
incompatible refactorings and loss of backwards compatibility, the decision was made to spin it off as a new package.
This package contains numerous enhancements over the original MsgPack implementation which should help with performance
in many places (see [benchmarks](benchmarks.md)), as well as a more complete testing suite.## Usage
Because this project relies on Dart Libraries which contain inconsistencies between
Dart 1.x and Dart 2.x, there are two versions of the this package maintained.If you want to use this package for Dart projects with Dart 2.x, please ensure your
version dependencies are set to:```yaml
dependencies:
msgpack2: ^2.0.0
```If you want to use this package for Dart projects with Dart 1.x, please ensure your
version dependencies are set to:```yaml
dependencies:
msgpack2: ^1.0.0
```## Simple Example
```dart
import "dart:typed_data";import "package:msgpack/msgpack.dart";
main() {
var binary = new Uint8List.fromList(
new List.generate(40, (int i) => i)
).buffer.asByteData();var data = {
"String": "Hello World",
"Integer": 42,
"Double": 45.29,
"Integer List": [1, 2, 3],
"Binary": binary,
"Map": {
1: 2,
3: 4
}
};List packed = pack(data);
Map unpacked = unpack(packed);print(unpacked);
}
```msgpack.org[dart-msgpack2]