binarize 1.0.0 copy "binarize: ^1.0.0" to clipboard
binarize: ^1.0.0 copied to clipboard

outdated

Binarize allows for a more streamlined and extendable binary creation experience.

example/main.dart

import 'package:binarize/binarize.dart';

void main() {
  // Writing bytes.
  final writer = Payload.write();
  writer.set(boolean, true);
  writer.set(flags, [true, false, true]);
  writer.set(float32, 1.5);
  writer.set(float64, 3.5);
  writer.set(int8, 5);
  writer.set(int16, -15);
  writer.set(int32, 38);
  writer.set(int64, -2050);
  writer.set(string, 'Hello world');
  writer.set(uint8, 5);
  writer.set(uint16, 15);
  writer.set(uint32, 30);
  writer.set(uint64, 60);

  // Converting to bytes.
  final byteList = binarize(writer);

  // Reading bytes.
  final reader = Payload.read(byteList);
  print(reader.get(boolean));
  print(reader.get(flags));
  print(reader.get(float32));
  print(reader.get(float64));
  print(reader.get(int8));
  print(reader.get(int16));
  print(reader.get(int32));
  print(reader.get(int64));
  print(reader.get(string));
  print(reader.get(uint8));
  print(reader.get(uint16));
  print(reader.get(uint32));
  print(reader.get(uint64));
}
47
likes
0
pub points
69%
popularity

Publisher

verified publisherwolfenra.in

Binarize allows for a more streamlined and extendable binary creation experience.

Repository (GitLab)
View/report issues

License

unknown (license)

More

Packages that depend on binarize