v1.2.3
buffer
用于高效处理字节缓冲区和流的实用函数和类,以读取和写入二进制数据格式。
19喜欢 22.9万近 30 天下载150Pub 分数
AndroidiOSWebmacOSWindowsLinux
用于字节缓冲区和流的 Dart 库。
以下为英文项目原文快照,最新内容请访问 GitHub。
Utility functions and classes to work with byte buffers and streams efficiently, to read and write binary data formats.
Here are some examples of how you can use the buffer package:
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