M
Metaphor
Hi all!
I want to make native code wrapper for java.
Then I found JNI, but I need more sample code.
For example, I want JNI to do following things.
1. C++ code makes file pointer.(use fopen())
2. C++ code runs JVM and make it load a class file.
3. This class writes "Hello World!" to the file pointer using fprintf()
wrapper.
4. Then control goes back to C++ code, and it close the pointer.(use
fclose())
Most important thing is that file pointer is exchanged between C++ code
and Java code.
Please give me a sample code or URL informed related things.
I want to make native code wrapper for java.
Then I found JNI, but I need more sample code.
For example, I want JNI to do following things.
1. C++ code makes file pointer.(use fopen())
2. C++ code runs JVM and make it load a class file.
3. This class writes "Hello World!" to the file pointer using fprintf()
wrapper.
4. Then control goes back to C++ code, and it close the pointer.(use
fclose())
Most important thing is that file pointer is exchanged between C++ code
and Java code.
Please give me a sample code or URL informed related things.