public abstract class JNICommonNativeUtil extends Object implements JVMNativeUtil
| Modifier and Type | Class and Description |
|---|---|
protected static class |
JNICommonNativeUtil.BufferPointerHandler |
| Constructor and Description |
|---|
JNICommonNativeUtil() |
| Modifier and Type | Method and Description |
|---|---|
String |
__get_cpuid_count_model() |
int[] |
__get_cpuid_count(int code,
int subcode) |
protected static void |
_free(long ptr) |
protected static long |
_malloc(long size) |
<T> T |
AllocObject(Class<T> clazz) |
Class<?> |
DefineClass(String name,
ClassLoader loader,
byte[] bytes,
int off,
int len) |
void |
DeleteGlobalRef(long ref) |
void |
free(long ptr) |
NativeField |
FromReflectedField(Field field) |
<R> NativeMethod<R,R> |
FromReflectedMethod(Constructor<R> method) |
NativeMethod |
FromReflectedMethod(Method method) |
long |
GetDirectBufferAddress(ByteBuffer buffer)
returns the native address of a direct byte buffer.
|
NativeMemory |
GetDirectBufferAddress(ByteBuffer buffer,
int off,
int size) |
NativeField |
GetFieldID(Class clazz,
String fieldName,
String signature) |
<R,D> NativeMethod<R,D> |
GetMethodID(Class<D> declaring,
String methodName,
String signature) |
int |
getPointerSize() |
NativeField |
GetStaticFieldID(Class clazz,
String fieldName,
String signature) |
<R,D> NativeMethod<R,D> |
GetStaticMethodID(Class<D> declaring,
String methodName,
String signature) |
boolean |
isJVM() |
boolean |
isNoop() |
NativeMemory |
malloc(long size) |
void |
MonitorEnter(Object obj) |
void |
MonitorExit(Object obj) |
ByteBuffer |
NewDirectByteBuffer(long ptr,
long capacity)
returns a direct byte buffer using the given pointer and capacity.
|
long |
NewGlobalRef(Object obj) |
<T> T |
NewLocalRef(long ref) |
NativeMemory |
pointer(long ptr,
long size,
PointerHandler handler)
Any calls to the resulting NativeMemory may cause the JVM to die due to a SEGFAULT is size is not specified correctly.
|
RuntimeException |
Throw(Throwable throwable) |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitisLinux, isWindowspublic int getPointerSize()
public boolean isJVM()
isJVM in interface NativeUtilpublic boolean isNoop()
isNoop in interface NativeUtilpublic void MonitorEnter(Object obj)
MonitorEnter in interface JVMNativeUtilpublic void MonitorExit(Object obj)
MonitorExit in interface JVMNativeUtilpublic Class<?> DefineClass(String name, ClassLoader loader, byte[] bytes, int off, int len)
DefineClass in interface JVMNativeUtilpublic NativeField FromReflectedField(Field field)
FromReflectedField in interface JVMNativeUtilpublic int[] __get_cpuid_count(int code,
int subcode)
public String __get_cpuid_count_model()
public NativeMemory GetDirectBufferAddress(ByteBuffer buffer, int off, int size)
GetDirectBufferAddress in interface JVMNativeUtilpublic RuntimeException Throw(Throwable throwable)
Throw in interface JVMNativeUtilpublic long NewGlobalRef(Object obj)
NewGlobalRef in interface JVMNativeUtilpublic void DeleteGlobalRef(long ref)
DeleteGlobalRef in interface JVMNativeUtilpublic <T> T NewLocalRef(long ref)
NewLocalRef in interface JVMNativeUtilpublic <T> T AllocObject(Class<T> clazz)
AllocObject in interface JVMNativeUtilpublic <R> NativeMethod<R,R> FromReflectedMethod(Constructor<R> method)
FromReflectedMethod in interface JVMNativeUtilpublic NativeMethod FromReflectedMethod(Method method)
FromReflectedMethod in interface JVMNativeUtilpublic <R,D> NativeMethod<R,D> GetMethodID(Class<D> declaring, String methodName, String signature)
GetMethodID in interface JVMNativeUtilpublic <R,D> NativeMethod<R,D> GetStaticMethodID(Class<D> declaring, String methodName, String signature)
GetStaticMethodID in interface JVMNativeUtilpublic NativeField GetFieldID(Class clazz, String fieldName, String signature)
GetFieldID in interface JVMNativeUtilpublic NativeField GetStaticFieldID(Class clazz, String fieldName, String signature)
GetStaticFieldID in interface JVMNativeUtilprotected static long _malloc(long size)
protected static void _free(long ptr)
public NativeMemory pointer(long ptr, long size, PointerHandler handler) throws NullPointerException
ptr - pointer to the datasize - -1 if unknown.NullPointerExceptionpublic NativeMemory malloc(long size) throws OutOfMemoryError, IllegalArgumentException
public void free(long ptr)
public long GetDirectBufferAddress(ByteBuffer buffer)
GetDirectBufferAddress in interface JVMNativeUtilpublic ByteBuffer NewDirectByteBuffer(long ptr, long capacity)
NewDirectByteBuffer in interface JVMNativeUtilCopyright © 2023. All rights reserved.