public class Native extends Object
| Modifier and Type | Field and Description |
|---|---|
static boolean |
IS_64 |
| Constructor and Description |
|---|
Native() |
| Modifier and Type | Method and Description |
|---|---|
static boolean |
bind(Class clazz,
String fn,
String sig,
long ptr)
Binds a function pointer to a native method.
|
static void |
deleteGlobalRef(long handle)
Deletes a global reference to an object.
|
static void |
free(long ptr)
Free the memory.
|
static void |
freeLibrary(long ptr)
Free the library.
|
static ByteBuffer |
fromPointer(long ptr,
long size)
Get an accessor for a given block of memory.
|
static long |
getMethodId(Class clazz,
String name,
String sig,
boolean isStatic)
Gets a method id.
|
static Object |
getObject(long handle)
Returns the object.
|
static long |
getObjectId(Object o)
Returns the object id.
|
static long |
getProcAddress(long ptr,
String name)
Get a pointer to a function exported by the library.
|
static long |
loadLibrary(String filename)
Load a native library (eg.
|
static long |
malloc(int size)
Allocate a block of memory.
|
static long |
newGlobalRef(Object obj)
Creates a global reference to an object.
|
public static long loadLibrary(String filename)
public static void freeLibrary(long ptr)
public static long getProcAddress(long ptr,
String name)
public static long malloc(int size)
public static void free(long ptr)
public static ByteBuffer fromPointer(long ptr, long size)
public static boolean bind(Class clazz, String fn, String sig, long ptr)
public static long newGlobalRef(Object obj)
public static void deleteGlobalRef(long handle)
public static long getObjectId(Object o)
public static Object getObject(long handle)
Copyright © 2018. All rights reserved.