Click or drag to resize

IJVMWrapperInternalDeclaredNewArrayTArrayType(ReadOnlyMemoryTArrayType) Method

Creates a new Java array, declared with the specified element type, from a read-only block of memory.

Namespace: MASES.JCOBridge.C2JBridge.JVMInterop
Assembly: C2JBridge (in C2JBridge.dll) Version: 2.6.10.261112-5ffe0920c00dbac056780af7ab9b1978b26ef4a5
Syntax
IJavaArray DeclaredNewArray<TArrayType>(
	ReadOnlyMemory<TArrayType> data
)
where TArrayType : struct, new()

Parameters

data  ReadOnlyMemoryTArrayType
The memory block whose elements are copied into the Java array.

Type Parameters

TArrayType
The type of the array elements. Only primitive types are supported: Boolean, Byte, Char, Int16, Int32, Int64, Single and Double.

Return Value

IJavaArray
An IJavaArray instance wrapping the newly created Java array.
Exceptions
ExceptionCondition
NotSupportedException The engine is not an HPA edition, or TArrayType satisfies the unmanaged constraint but is not one of the supported primitive types.
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, but on the other editions it is not functional. Check IsHPAEdition before calling it:

C#
if (JCOBridge.IsHPAEdition)
{
    bridge.DeclaredNewArray(memory);
}
else
{
    bridge.DeclaredNewArray(segment); // fallback available on every edition
}
See Also