serializePPTFragments method
Uint8List
serializePPTFragments({
- Uint8List? argumentsBytes,
- Uint8List? argumentsKeywordsBytes,
- List? arguments,
- Map<
String, dynamic> ? argumentsKeywords,
override
Serializer PPT payload from already-encoded args / kwargs fragments when the payload serializer matches the surrounding transport serializer.
Implementation
@override
Uint8List serializePPTFragments({
Uint8List? argumentsBytes,
Uint8List? argumentsKeywordsBytes,
List<dynamic>? arguments,
Map<String, dynamic>? argumentsKeywords,
}) {
final argsJson = argumentsBytes == null
? _encodeJsonObject(arguments)
: _utf8Decoder.convert(argumentsBytes);
final kwargsJson = argumentsKeywordsBytes == null
? _encodeJsonObject(argumentsKeywords)
: _utf8Decoder.convert(argumentsKeywordsBytes);
final builder = StringBuffer()
..write('{"args": ')
..write(argsJson)
..write(', "kwargs": ')
..write(kwargsJson)
..write('}');
return Utf8Encoder().convert(builder.toString());
}