My problem is like this. I have serialized binary Java objects stored in files. I need to reconstruct the objects in C++ and do further process.
I think I can deserialize the Java objects using Java, serialize again into acsii files, then load in C++ code. Also, I know it's possible to call Java function from C++ using JNI, but I don't know how to pass parameters, i.e., return the objects back to C++. But is there a better way?
Thanks!
解决方案
You can open the serialized files direcly and pickup the data from C++. You can see the specification but I recomend to start reading an article like The Java serialization algorithm revealed.
But the easier and for me the better way is to load the objects in Java again and Serialize it to JSON with a java library like google-gson or others.