|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.jikesrvm.jni.JNIGenericHelpers
public abstract class JNIGenericHelpers
Platform independent utility functions called from JNIFunctions (cannot be placed in JNIFunctions because methods there are specially compiled to be called from native).
JNIFunctions
Constructor Summary | |
---|---|
JNIGenericHelpers()
|
Method Summary | |
---|---|
static byte[] |
createByteArrayFromC(Address stringAddress)
Given an address in C that points to a null-terminated string, create a new Java byte[] with a copy of the string. |
private static String |
createString(CharsetDecoder csd,
ByteBuffer bbuf)
Create a string from the given charset decoder and bytebuffer |
static String |
createStringFromC(Address stringAddress)
Given an address in C that points to a null-terminated string, create a new Java String with a copy of the string. |
static void |
createUTFForCFromString(String str,
Address copyBuffer,
int len)
Convert a String into a a malloced region |
static String |
createUTFStringFromC(Address stringAddress)
Given an address in C that points to a null-terminated string, create a new UTF encoded Java String with a copy of the string. |
(package private) static void |
setBoolStar(Address boolPtr,
boolean val)
A JNI helper function, to set the value pointed to by a C pointer of type (jboolean *). |
static int |
strlen(Address ptr)
Compute the length of the given null-terminated string |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public JNIGenericHelpers()
Method Detail |
---|
public static int strlen(Address ptr)
ptr
- address of string in memory
public static byte[] createByteArrayFromC(Address stringAddress)
stringAddress
- an address in C space for a string
private static String createString(CharsetDecoder csd, ByteBuffer bbuf) throws CharacterCodingException
CharacterCodingException
public static String createStringFromC(Address stringAddress)
stringAddress
- an address in C space for a string
public static String createUTFStringFromC(Address stringAddress)
stringAddress
- an address in C space for a string
public static void createUTFForCFromString(String str, Address copyBuffer, int len)
static void setBoolStar(Address boolPtr, boolean val)
boolPtr
- Native pointer to a jboolean variable to be set. May be
the NULL pointer, in which case we do nothing.val
- Value to set it to (usually TRUE)
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |