dco_decode_network_target method

  1. @protected
NetworkTarget dco_decode_network_target(
  1. dynamic raw
)
override

Implementation

@protected
NetworkTarget dco_decode_network_target(dynamic raw) {
  // Codec=Dco (DartCObject based), see doc to use other codecs
  final arr = raw as List<dynamic>;
  if (arr.length != 7)
    throw Exception('unexpected arr length: expect 7 but see ${arr.length}');
  return NetworkTarget(
    label: dco_decode_String(arr[0]),
    host: dco_decode_String(arr[1]),
    port: dco_decode_u_16(arr[2]),
    protocol: dco_decode_target_protocol(arr[3]),
    timeoutMs: dco_decode_u_64(arr[4]),
    priority: dco_decode_u_8(arr[5]),
    isEssential: dco_decode_bool(arr[6]),
  );
}