msgPackRead function

dynamic msgPackRead(
  1. Uint8List bytes, {
  2. dynamic fromEncodable(
    1. dynamic
    )?,
  3. List<MsgPackExtension>? extensions,
})

Shortcut function to read a object from a Uint8List buffer

  • bytes: The Uint8List byte buffer to read from
  • fromEncodable: A custom function the converts the deserialized Map<String, dynamic> representation of the object into the object
  • extensions: A optional list of extensions to use

Returns the underlying object after successful deserialization

Implementation

dynamic msgPackRead(Uint8List bytes,
    {dynamic Function(dynamic)? fromEncodable,
    List<MsgPackExtension>? extensions}) {
  final reader = MsgPackReader(bytes,
      fromEncodable: fromEncodable, extensions: extensions);
  return reader.read();
}