Search packages, repositories and app categories

Package detailsv1.2.3

buffer

Utility functions and classes to work with byte buffers and streams efficiently, to read and write binary data formats.

AndroidiOSWebmacOSWindowsLinux
30-day downloads
728K
Likes
19
Pub points
150

Install package

flutter pub add buffer

Package Overview

Package selection guidance compiled from public package information, community data, and project usage.

The buffer package provides utility functions and classes for efficient handling of byte buffers and streams in Dart. It enables seamless reading and writing of binary data formats, offering a robust foundation for low-level data manipulation. Designed for performance and simplicity, it supports various platforms including mobile, web, and desktop. Ideal for developers working with network protocols, file formats, or serialization tasks that require precise control over binary data.

Use cases

  • Reading and writing binary data
  • Parsing custom file formats
  • Implementing network protocols
  • Handling raw data streams
  • Serializing/deserializing binary payloads

Key features

  • Efficient byte buffer operations
  • Stream-based binary I/O
  • Cross-platform compatibility
  • Simple API for binary data
  • Support for endianness conversion

Suitable for

  • Low-level data processing
  • Network and protocol development
  • File format parsers
  • Binary serialization
  • Performance-critical applications

Considerations

  • Requires understanding of binary data concepts
  • Not suitable for high-level text or JSON processing
  • May need additional error handling for malformed data
  • Best used in conjunction with other I/O libraries

Original README

Original README snapshot from the linked source repository. Visit the repository for the latest content.

Buffer - Dart library for byte buffers and streams.

Pub

Utility functions and classes to work with byte buffers and streams efficiently, to read and write binary data formats.

Examples

Here are some examples of how you can use the buffer package:

Writing to a ByteDataWriter and reading from a ByteDataReader

This example demonstrates how to write unsigned integers of different sizes to a ByteDataWriter and then read them back using a ByteDataReader.

final writer = ByteDataWriter();
writer.writeUint8(255);
writer.writeUint16(65535);
writer.writeUint32(4294967295);

final reader = ByteDataReader();
reader.add(writer.toBytes());
print(reader.readUint8()); // Output: 255
print(reader.readUint16()); // Output: 65535
print(reader.readUint32()); // Output: 4294967295

Categories

Source repository

Projects using this package