- 590 名前:デフォルトの名無しさん mailto:sage [2008/08/14(木) 01:26:18 ]
- こんな感じ?
#include <jni.h> JNIEXPORT jobject JNICALL Java_Goodbye_getGoodbye(JNIEnv *env, jclass clazz) { return (*env)->NewDirectByteBuffer(env, "goodbye", 7); } import java.nio.*; public class Goodbye { public static void main(String[] args) { System.loadLibrary("goodbye"); ByteBuffer buffer = getGoodbye(); byte[] b = new byte[buffer.remaining()]; buffer.get(b); System.out.println(new String(b)); } private static native ByteBuffer getGoodbye(); }
|

|