toByteBufferList method

List<ByteBuffer> toByteBufferList()

Implementation

List<ByteBuffer> toByteBufferList() {
  if (this is InternalClassListDart) {
    return (this as InternalClassListDart).data.map((e) => e as ByteBuffer).toList();
  }
  var result = <ByteBuffer>[];
  final length = count();
  for (int i = 0; i < length; i++) {
    var item = UnitRCCppFunc.instance.getByteBufferList(toCpp(), i);
    if (item is ByteBuffer) {
      result.add(item);
    } else {
      UnitRCLog.error("toByteBufferList invalid item type: ${item.runtimeType}");
    }
  }
  return result;
}