add method

  1. @override
void add(
  1. List<int> data
)
override

Adds data to the sink.

Must not be called after a call to close.

Implementation

@override
void add(List<int> data) {
  _stream.write(Uint8List.fromList(data));
  // Note: P2PStream.write is often async. If writeDelimitedMessage expects synchronous writes
  // or needs flow control, this adapter might need to be more complex (e.g., using a StreamController).
  // For now, assuming P2PStream.write handles buffering or is suitably async.
}