buff 1.0.1 copy "buff: ^1.0.1" to clipboard
buff: ^1.0.1 copied to clipboard

A buffer library for dart.

example/buff_example.dart

import 'dart:typed_data';

import 'package:buff/buff.dart';

void main() {
  final bytes = Uint8List.fromList([1, 2, 3, 4, 5, 6, 7, 8, 9, 10]);
  
  // Using BufferInput
  final bufferInput = BufferInput.memory(bytes);
  final buffer = bufferInput.getBytes(2, 6);
  print(buffer); // Output: [3, 4, 5, 6]
  bufferInput.close();
  
  // Using AsyncBufferInput
  final asyncBufferInput = AsyncBufferInput.memory(bytes);
  asyncBufferInput.getBytes(4, 6).then((buffer) {
    print(buffer); // Output: [3, 4]
    asyncBufferInput.close();
  });
}
0
likes
130
points
76
downloads

Publisher

unverified uploader

Weekly Downloads

A buffer library for dart.

Repository (GitHub)
View/report issues

Documentation

API reference

License

Apache-2.0 (license)

More

Packages that depend on buff