write method

Future<void> write(
  1. CID cid,
  2. Uint8List block
)

Writes a single section.

The cid and block bytes are buffered until close or closeStream is called.

Implementation

Future<void> write(CID cid, Uint8List block) async {
  if (block.length > maxBlockSize) {
    throw CarSectionException(
      'Block size ${block.length} exceeds maximum $maxBlockSize',
    );
  }
  _pending.add(_PendingSection(cid, block));
}