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
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 wrappeduseMemoryControlBlock
boolAppends to the end of the
data
a memory block will be used to controls and arbitrates memory between CLR and JVMarrangeCapacity
boolIf true the
TData
array indata
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 ofdata
timeToLive
intThe 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