Table of Contents

Class JNetCoreExtensions

Namespace
MASES.JNet.Specific.Extensions
Assembly
MASES.JNet.dll

Extension class

public static class JNetCoreExtensions
Inheritance
JNetCoreExtensions
Inherited Members

Methods

Class<TClass>(TClass)

Retrieve the Class<T> from the TClass

public static Class<TClass> Class<TClass>(this TClass _) where TClass : IJVMBridgeBase, new()

Parameters

_ TClass

Returns

Class<TClass>

The Class<T>

Type Parameters

TClass

A class extending MASES.JCOBridge.C2JBridge.IJVMBridgeBase

DirectBufferWithWrap<TData, TWrap>(TData[], bool, bool, int, Func<ByteBuffer, TWrap>)

The method creates a ByteBuffer and wrap it into TWrap

public static TWrap DirectBufferWithWrap<TData, TWrap>(this TData[] data, bool useMemoryControlBlock = true, bool arrangeCapacity = true, int timeToLive = -1, Func<ByteBuffer, TWrap> converter = null) where TWrap : IJVMBridgeBase, new()

Parameters

data TData[]

The array of TData to be wrapped

useMemoryControlBlock bool

Appends to the end of the data a memory block will be used to controls and arbitrates memory between CLR and JVM

arrangeCapacity bool

If true the TData array in data will be resized to the next power of 2, so capacity will be memory aligned and the limit of java.nio.ByteBuffer will be current size of data

timeToLive int

The time to live, expressed in milliseconds, the underlying memory shall remain available; if the time to live expires the pinned memory is retired leaving potentially the JVM under the possibility of an access violation.

converter Func<ByteBuffer, TWrap>

A Func<T, TResult> that receives the prepared ByteBuffer and shall return TWrap

Returns

TWrap

The TWrap instance

Type Parameters

TData

The data to be wrapped

TWrap

The wrapping class