encode method Null safety

void encode(
  1. XdrDataOutputStream stream,
  2. XdrAuthorizedInvocation encoded
)

Implementation

static void encode(
    XdrDataOutputStream stream, XdrAuthorizedInvocation encoded) {
  XdrHash.encode(stream, encoded.contractID);
  stream.writeString(encoded.functionName);

  int argsSize = encoded.args.length;
  stream.writeInt(argsSize);
  for (int i = 0; i < argsSize; i++) {
    XdrSCVal.encode(stream, encoded.args[i]);
  }
  int subInvocationsSize = encoded.subInvocations.length;
  stream.writeInt(subInvocationsSize);
  for (int i = 0; i < subInvocationsSize; i++) {
    XdrAuthorizedInvocation.encode(stream, encoded.subInvocations[i]);
  }
}