serializers (1.0.0)

Published 2026-08-22 11:32:37 +00:00 by Platform

Installation

dart pub add serializers:1.0.0 --hosted-url=

About this package

Binary serialization: ByteReader/ByteWriter utilities for compact wire-format encoding.

Dart.Package.Serializers

Binary serialization: ByteReader/ByteWriter utilities for compact wire-format encoding (ported from the old platform).

Quick start

import 'package:serializers/serializers.dart';

final writer = ByteWriter()
  ..writeInt(42)
  ..writeString('hello')
  ..writeBool(true);

final reader = ByteReader(writer.toArray());
print(reader.readInt());     // 42
print(reader.readString());  // hello
print(reader.readBool());    // true

ByteWriter grows its internal buffer as needed and exposes toArray() for the written bytes. ByteReader tracks a read position and throws on out-of-range reads. Both cover byte/bool/char/short/int/long (via BigInt for 64-bit)/float/double, length-prefixed strings and byte arrays, GUIDs, and typed arrays.

Project structure

pubspec.yaml
Version.txt
lib/
├── serializers.dart          public API — exports
└── src/
    ├── byte_reader.dart       ByteReader
    └── byte_writer.dart       ByteWriter
test/
└── serializers_test.dart
example/
└── example.dart

Versioning and publishing

Version.txt is the exact version that gets published — a push to main publishes it only when that version isn't on the feed yet. Pushes to any other branch only resolve and test.

CI

.forgejo/workflows/build.yml installs the Dart SDK, resolves dependencies, and runs dart test on every push. On main, it also publishes via dart pub publish, tags the commit v<version>, and creates a matching Release — via the shared Platform/Forgejo.Package.Actions/dart-publish composite action. .forgejo/workflows/cleanup.yml removes prerelease Pub versions when their branch is deleted.

Details
Pub
2026-08-22 11:32:37 +00:00
713
4.9 KiB
Assets (1)
1.0.0.tar.gz 4.9 KiB
Versions (1) View all
1.0.0 2026-08-22