WriteArrayAsGenericType