serializePPTFragments method

  1. @override
Uint8List serializePPTFragments({
  1. Uint8List? argumentsBytes,
  2. Uint8List? argumentsKeywordsBytes,
  3. List? arguments,
  4. 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,
}) {
  if (argumentsBytes != null || argumentsKeywordsBytes != null) {
    throw UnsupportedError(
      'Typed FlatBuffers PPT requires a single application byte buffer',
    );
  }
  if (argumentsKeywords != null ||
      arguments?.length != 1 ||
      arguments!.single is! Uint8List) {
    throw UnsupportedError(
      'Typed FlatBuffers PPT requires a single application byte buffer',
    );
  }
  final bytes = arguments.single as Uint8List;
  if (bytes.length > 64 * 1024 * 1024) {
    throw ArgumentError('FlatBuffers PPT payload exceeds the byte limit');
  }
  return bytes;
}