serializeAll function

Uint8List serializeAll(
  1. Iterable values, {
  2. EncodeExt? encodeExt,
  3. int initialBufferSize = 1024,
})

Serializes a sequence of values into a single MessagePack buffer.

This is useful for streaming or protocol-level implementations where multiple MessagePack objects are concatenated without a top-level array.

encodeExt and initialBufferSize behave the same as in serialize.

Throws a MessagePackException if any value fails to serialize.

Implementation

@pragma('vm:prefer-inline')
Uint8List serializeAll(
  Iterable<dynamic> values, {
  EncodeExt? encodeExt,
  int initialBufferSize = 1024,
}) => Packer.encodeAll(
  values,
  encodeExt: encodeExt,
  initialBufferSize: initialBufferSize,
);