buffer
1.2.3, released 3 years ago by agilord.com
Utilities and classes for reading and writing byte buffers and binary data streams.
What it does
Provides ByteDataWriter and ByteDataReader classes to simplify reading and writing binary data formats. It allows working with byte sequences and streams efficiently, handling operations like reading/writing integers of various byte sizes and null-terminated byte sequences. It has zero external dependencies and runs on all Dart/Flutter platforms.
AI-written summary of version 1.2.3, based on the package's README and metadata. Report an inaccuracy
Use it when
- Building custom binary protocol decoders or encoders.
- Reading and writing structured binary data to or from byte buffers incrementally.
- Handling null-terminated bytes and variable-length integer byte streams.
Skip it when
- Working only with text-based formats like JSON or XML.
- Standard Dart typed_data ByteData methods are sufficient for your simple buffer operations.
Strengths
- Zero external dependencies.
- Convenient sequential reader and writer APIs compared to manual index management with ByteData.
- Cross-platform support across mobile, web, and desktop.
Weaknesses
- README documentation is very brief with only a single minimal example.
Setup
- Kind
- Pure Dart
- Effort
- Low
- Code generation
- No
- Direct dependencies
- 0
final writer = ByteDataWriter();
writer.writeUint8(255);
writer.writeUint16(65535);
writer.writeUint32(4294967295);
final reader = ByteDataReader();
reader.add(writer.toBytes());
print(reader.readUint8());
print(reader.readUint16());
print(reader.readUint32());Alternatives
Packages that do the same job and could replace buffer.
- async
Utility classes and helpers that extend Dart's async library.
83Compare - stream_transform
Extension methods adding common stream transform operators
91Compare - gtk
GTK utilities for Flutter Linux applications, providing settings and application lifecycle helpers.
76Compare - flutter_flavorizr
A utility to easily create and configure application flavors in Flutter.
86Compare
Works with
Packages commonly used together with buffer: ones it builds on, ones built on it, and its own family.
- postgresBuilt on bufferPostgreSQL driver for Dart supporting binary protocol, pooling and statement reuse.
- sasl_scramBuilt on bufferSASL SCRAM authentication implementation in Dart supporting scram-1 and scram-256.
- minioBuilt on bufferUnofficial MinIO and S3-compatible object storage client SDK for Dart and Flutter.
- mysql_client_plusBuilt on bufferNative MySQL client written in Dart with connection pooling, transactions, and TLS support.
- mysql_clientBuilt on bufferNative MySQL and MariaDB client written in Dart.
- dart_libp2pBuilt on bufferA Dart implementation of the libp2p networking stack for peer-to-peer applications.
- http_clientBuilt on bufferPlatform‑independent HTTP client for browser, console and curl with SOCKS proxy support
- advance_mathBuilt on bufferA Dart library for mathematical programming, complex numbers, algebra, statistics, and geometry.