u8list_extensions 1.1.0 copy "u8list_extensions: ^1.1.0" to clipboard
u8list_extensions: ^1.1.0 copied to clipboard

Extensions for Uint8List.

u8list_extensions #

pub package

Extensions for Uint8List.

Usage #

final data = Uint8List.fromList(List.generate(20, (index) => index + 1));

// Example of subView
final sublist1 = data.subView(1, 5);
print(sublist1); // Output: [2, 3, 4, 5]

// Example of subViewWithLength
final sublist2 = data.subViewWithLength(15, 3);
print(sublist2); // Output: [16, 17, 18]

// Example of toHexString
final hexString = data.subView(10).toHexString(separator: ' ');
print(hexString); // Output: "0b 0c 0d 0e 0f 10 11 12 13 14"

// Example of asByteData
final byteData = data.asByteData(5, 6);
print(byteData.getUint8(0)); // Output: 6

// Example of asByteDataWithLength
final byteDataWithLength = data.asByteDataWithLength(5, 1);
print(byteDataWithLength.getUint8(0)); // Output: 6

// Example of toHexPreview
final hexPreview = data.toHexPreview(maxLength: 10);
print(hexPreview); // Output: "01 02 03 04 05 ... 10 11 12 13 14"
0
likes
150
points
121
downloads

Publisher

verified publisherflutter-cavalry.com

Weekly Downloads

Extensions for Uint8List.

Repository (GitHub)
View/report issues

Documentation

API reference

License

BSD-3-Clause (license)

More

Packages that depend on u8list_extensions