bjdataEncode function
List<int>
bjdataEncode(
- Object? object, {
- Object? toEncodable(
- Object? nonEncodable
- BjdataConfig config = const BjdataConfig(),
Converts object into BJData.
Any list that is a uniform table of two or more records is written as a Structure-of-Arrays container instead of an array of objects. Lists that are not uniform tables are written unchanged, so the decoded values are the same either way.
config selects the container layout and the specification revision to stay
within. Use BjdataConfig.draft3 for a consumer that predates draft 4, or
BjdataConfig(soa: BjdataSoaLayout.off) to keep writing plain arrays of objects.
Both layouts decode back to the list of records they were given.
Implementation
List<int> bjdataEncode(
Object? object, {
Object? Function(Object? nonEncodable)? toEncodable,
BjdataConfig config = const BjdataConfig(),
}) =>
bjdata.encode(object, toEncodable: toEncodable, config: config);