decodeMethodCall method

  1. @override
MethodCall decodeMethodCall (ByteData methodCall)
override

Decodes the specified methodCall from binary.

Implementation

@override
MethodCall decodeMethodCall(ByteData methodCall) {
  final ReadBuffer buffer = ReadBuffer(methodCall);
  final dynamic method = messageCodec.readValue(buffer);
  final dynamic arguments = messageCodec.readValue(buffer);
  if (method is String && !buffer.hasRemaining)
    return MethodCall(method, arguments);
  else
    throw const FormatException('Invalid method call');
}