encode method

  1. @override
BcsWriter encode(
  1. dynamic data,
  2. BcsWriterOptions? options,
  3. List typeParams
)
override

Implementation

@override
BcsWriter encode(data, options, typeParams) {
  final typeMap = <String, dynamic>{};
  for (var i = 0; i < generics.length; i++) {
    typeMap[generics[i]] = typeParams[i];
  }

  final bcsWriter = BcsWriter(
    size: options?.size ?? 4096,
    maxSize: options?.maxSize,
    allocateSize: options?.allocateSize ?? 1024);
  return encodeRaw(bcsWriter, data, typeParams, typeMap);
}