https://github.com/helightdev/duffer
A pure dart library offering support for netty-like byte buffer manipulation and binary serialization via a pickle inspired system.
https://github.com/helightdev/duffer
buffer dart flutter serialization
Last synced: about 1 year ago
JSON representation
A pure dart library offering support for netty-like byte buffer manipulation and binary serialization via a pickle inspired system.
- Host: GitHub
- URL: https://github.com/helightdev/duffer
- Owner: helightdev
- License: apache-2.0
- Created: 2022-03-07T16:56:56.000Z (about 4 years ago)
- Default Branch: main
- Last Pushed: 2023-09-08T03:45:02.000Z (over 2 years ago)
- Last Synced: 2025-03-24T12:21:49.317Z (about 1 year ago)
- Topics: buffer, dart, flutter, serialization
- Language: Dart
- Homepage:
- Size: 173 KB
- Stars: 6
- Watchers: 1
- Forks: 2
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
A pure dart library offering support for netty-like byte buffer manipulation and binary serialization
via a pickle inspired system.
---
## Features
| Feature | Status |
|:-------------------:|:----------------:|
| Buffers | ✅ |
| Read/Write | ✅ |
| Get/Set | ✅ |
| Child Buffers | ✅ |
| Unpooled | ✅ |
| Pooled | ✅ |
| Primitive Datatypes | ✅ |
| Hex Encoding | ✅ |
| Base64 Encoding | ✅ |
| File Buffers | ✅ (experimental) |
| Streamed Buffers | ✅ |
## Getting started
After you've imported the library with
```dart
import 'package:duffer/duffer.dart';
```
You can creates buffers via the `Unpooled` and `Pooled`
utility classes and just write to it and read from it
```dart
var buffer = Unpooled.buffer();
buffer.writeLPString("Hello World!");
buffer.writeInt32(42);
print(buffer.readLPString()); // Hello World!
print(buffer.readInt32()); // 42
```
or parse existing data via one of the various extension functions.
```dart
var buffer1 = "SGVsbG8gV29ybGQ=".parseBase64();
var buffer2 = "0000000b48656c6c6f20576f726c64".parseHex();
```
You can also encode your buffer using base64 or hex.
```dart
print(buffer.hex);
print(buffer.base64);
```
For more samples just have a look at the examples folder.