Write expected length of out arrays to parcel

This makes generated C++ consistent with the Java.

Unfortunately, C++ server authors still need to understand
that if they resize inout/out arrays, this will cause runtime exceptions
for Java clients, which cannot resize their array types.
Addressing this is a much more invasive patch.

Bug: 30836680
Change-Id: I996bfea8383d6207377e7bc545d3d39c21bbe033
Test: integration and unit tests continue to pass
diff --git a/generate_cpp_unittest.cpp b/generate_cpp_unittest.cpp
index 6cdf835..50bfd9c 100644
--- a/generate_cpp_unittest.cpp
+++ b/generate_cpp_unittest.cpp
@@ -117,6 +117,10 @@
 if (((_aidl_ret_status) != (::android::OK))) {
 goto _aidl_error;
 }
+_aidl_ret_status = _aidl_data.writeVectorSize(*goes_out);
+if (((_aidl_ret_status) != (::android::OK))) {
+goto _aidl_error;
+}
 _aidl_ret_status = remote()->transact(IComplexTypeInterface::SEND, _aidl_data, &_aidl_reply);
 if (((_aidl_ret_status) != (::android::OK))) {
 goto _aidl_error;
@@ -426,6 +430,10 @@
 if (((_aidl_ret_status) != (::android::OK))) {
 break;
 }
+_aidl_ret_status = _aidl_data.resizeOutVector(&out_goes_out);
+if (((_aidl_ret_status) != (::android::OK))) {
+break;
+}
 ::android::binder::Status _aidl_status(Send(in_goes_in, &in_goes_in_and_out, &out_goes_out, &_aidl_return));
 _aidl_ret_status = _aidl_status.writeToParcel(_aidl_reply);
 if (((_aidl_ret_status) != (::android::OK))) {