msgPackWrite function
Uint8List
msgPackWrite(
- dynamic value, {
- Map<
String, dynamic> toEncodable(- dynamic
- List<
MsgPackExtension> ? extensions,
Shortcut function to write a object to a Uint8List buffer
toEncodable
: A custom function that converts the object to aMap<String, dynamic>
representationextensions
: A optional list of extensions to use
Returns a Uint8List buffer with the object representation in bytes after successful serialization
Implementation
Uint8List msgPackWrite(dynamic value,
{Map<String, dynamic> Function(dynamic)? toEncodable,
List<MsgPackExtension>? extensions}) {
final writer =
MsgPackWriter(toEncodable: toEncodable, extensions: extensions);
writer.write(value);
return writer.takeBytes();
}