I'm writing a game that is mostly in Java (because that's the language I'm most comfortable with) while the graphics are in C++ (because of speed, and because the Vulkan API is hard enough to learn when I'm not using a third-party language binding). I start a thread in Java and have it create a Swing window, it then runs a native method that takes the HWND handle from the window and some other information as parameters. Once in native code it binds the window to a Vulkan surface and from their the graphics engine is it's own independent thread, if possible I don't want to make any more JNI calls (performance concerns).
My issue is, I handle server-client connectivity on the Java end, and my server is responsible for sending the client models and textures when the player needs them. The obvious solution would be to pass these textures and models over JNI so that the graphics engine can make use of them but I'd REALLY like to not do that.
I've considered using memory mapped files but that would require using boost since there otherwise isn't a cross-platform mmap library, and it also seemed silly to me that I'd get the data over the network, it'd then be stored in RAM, and then I'd allocate it a different area of RAM so that it can be accessed in native.
Other than JNI and memory mapping I, with my limited experience, cannot think of any other possible solution to this problem and am hoping to find some suggestions or perhaps some inspiration. This question isn't strictly related to game development and I considered asking it over at Stackoverflow but their community is really doo doo.