serializeIterable method

void serializeIterable(
  1. Iterable data
)

Implementation

void serializeIterable(Iterable data) {
  if (data is Uint8Buffer) {
    writeBuff(data);
  } else if (data is Uint8List) {
    writeBytes(Uint8Buffer()..addAll(data));
  } else if (data.every((element) => element is int)) {
    writeBytes(Uint8Buffer()..addAll(List<int>.from(data)));
  } else if (data is List) {
    writeTypeValue(cbor.majorTypeArray, data.length);
    for (final byte in data) {
      if (getEncoderFor(byte) != null) {
        writeExtra(byte);
      } else if (byte is Map) {
        serializeMap(byte);
      } else if (byte is Iterable) {
        serializeIterable(byte);
      } else if (byte is int) {
        _out.putByte(byte);
      } else {
        serializeData(byte);
      }
    }
  }
}