receive method

void receive(
  1. Map map
)

This receive stream data from native, put them in streamBufferMaps

Implementation

void receive(Map map) {
  if (!_working) {
    slog.d("[Debug Tag $debugTag] _enable is false, so return", tag: _tag);
    return;
  }
  slog.d("[Debug Tag $debugTag] receive stream map $map", tag: _tag);
  if (map.containsKey("streamId") && map.containsKey("data")) {
    String streamId = map["streamId"];
    if (map["data"] != null && map["data"] is Iterable) {
      _receive(streamId, (map["data"] as Iterable).map((e) => e as int).toBuiltList(),
          isEnd: map["state"] == streamEndFlag || map["state"] == streamErrorFlag,
          isError: map["state"] == streamErrorFlag);
    } else {
      slog.d("[Debug Tag $debugTag] streamId $streamId data format error", tag: _tag);
    }
  } else {
    slog.d("[Debug Tag $debugTag] receive wrong data", tag: _tag);
  }
}