* Signature: (J)Ljava/lang/String;
*/
JNIEXPORT jstring JNICALL Java_org_ocera_orte_types_RecvInfo_get_1string
- (JNIEnv *, jobject, jlong);
+ (JNIEnv *, jclass, jlong);
/*
* Class: org_ocera_orte_types_RecvInfo
* Signature: (Ljava/nio/ByteBuffer;)V
*/
JNIEXPORT void JNICALL Java_org_ocera_orte_types_RecvInfo_c_1helper
- (JNIEnv *, jobject, jobject);
+ (JNIEnv *, jclass, jobject);
#ifdef __cplusplus
}
* [15] offsetof(SequenceNumber,high),
* [16] offsetof(SequenceNumber,low)
*/
- private ByteBuffer helper_buffer;
+ static ByteBuffer helper_buffer;
+
+ static {
+ helper_buffer = ByteBuffer.allocateDirect(17*Integer.SIZE/8);
+ helper_buffer.order(ByteOrder.nativeOrder());
+ c_helper(helper_buffer);
+ }
public RecvInfo()
{
//System.out.println(":j: instance of RecvInfo created..");
- this.helper_buffer = ByteBuffer.allocateDirect(17*Integer.SIZE/8);
- this.helper_buffer.order(ByteOrder.nativeOrder());
- this.c_helper(helper_buffer);
-
this.info_buffer = ByteBuffer.allocateDirect(helper_buffer.getInt(0));
this.info_buffer.order(ByteOrder.nativeOrder());
}
/* NATIVE FUNCTIONS */
- private native String get_string(long string_pointer);
- private native void c_helper(ByteBuffer buffer);
+ static native String get_string(long string_pointer);
+ static native void c_helper(ByteBuffer buffer);
}
* Signature: (Ljava/nio/ByteBuffer;)V
*/
JNIEXPORT void JNICALL Java_org_ocera_orte_types_RecvInfo_c_1helper
- (JNIEnv *env, jobject obj, jobject b_buffer) {
+ (JNIEnv *env, jclass cls, jobject b_buffer) {
int32_t* buffer = (*env)->GetDirectBufferAddress(env, b_buffer);
* Signature: (J)Ljava/lang/String;
*/
JNIEXPORT jstring JNICALL Java_org_ocera_orte_types_RecvInfo_get_1string
- (JNIEnv *env, jobject obj, jlong string_ptr) {
+ (JNIEnv *env, jclass cls, jlong string_ptr) {
return (*env)->NewStringUTF(env, (char*) string_ptr);
}