Click or drag to resize

IJavaArraySetT(Int32, ReadOnlySpanT) Method

Sets the elements in values starting from the position startIndex of the Java array.

Namespace: MASES.JCOBridge.C2JBridge.JVMInterop
Assembly: C2JBridge (in C2JBridge.dll) Version: 2.6.10.261112-5ffe0920c00dbac056780af7ab9b1978b26ef4a5
Syntax
void Set<T>(
	int startIndex,
	ReadOnlySpan<T> values
)
where T : struct, new()

Parameters

startIndex  Int32
The zero-based index of the Java array at which the first element is written.
values  ReadOnlySpanT
The span of elements to copy into the Java array.

Type Parameters

T
The element type of values. Only the native primitives are supported (bool, byte, char, short, int, long, float, double). The type must match the element type of the Java array.
Exceptions
ExceptionCondition
NotSupportedExceptionThe engine is not an HPA edition, or T is not one of the supported primitive types.
ArgumentOutOfRangeExceptionstartIndex is negative.
InvalidCastExceptionT is not consistent with the element type of the Java array.
NullReferenceExceptionThe Java array is .
IndexOutOfRangeExceptionThe elements do not fit in the Java array starting from startIndex.
Remarks

Supported only on the HPA Edition. The method is part of the public API on every edition so that code can be written once and adapted at runtime: check IsHPAEdition before calling it and use the ArraySegmentT overload otherwise.

A ReadOnlySpanT cannot be boxed, so it cannot be passed through object-based or dynamic invocations: use this typed overload directly.

See Also