I have Java application that invokes native C++/C code. The C++/C code needs to callback into Java. Could you give me some examples how to do this.
相关问题
- Delete Messages from a Topic in Apache Kafka
- Jackson Deserialization not calling deserialize on
- How to maintain order of key-value in DataFrame sa
- StackExchange API - Deserialize Date in JSON Respo
- Difference between Types.INTEGER and Types.NULL in
There are many valid ways to callback into Java from C/C++. I'm going to show you a technique using C (easy to adjust env for C++) that makes it fairly easy to pass data from native code to Java code. This example passes strings ( easy to modify for any data type ).
In native code, create the following:
In Java code create the following:
Native usage to send data:
Java usage to receive data: