encodePayloadAsBinary static method

dynamic encodePayloadAsBinary(
  1. List packets,
  2. dynamic callback(
    1. dynamic _
    )
)

Implementation

static encodePayloadAsBinary(List packets, Function(dynamic _) callback) {
  if (packets.isEmpty) {
    return callback(Uint8List(0));
  }

  map(packets, encodeOneBinaryPacket, (results) {
    var list = [];
    results.forEach((e) => list.addAll(e));
    return callback(list);
  });
}