I have a C++ piece of code that creates shared memory. Is it possible to write Java Code which can read the memory created by the C++ code unless using JNI. By the way I am using Windows OS.
-
1To use native memory without using native interface?Öö Tiib– Öö Tiib2013-02-28 07:58:58 +00:00Commented Feb 28, 2013 at 7:58
-
Access to off heap memory could be the answer.assylias– assylias2013-02-28 08:01:10 +00:00Commented Feb 28, 2013 at 8:01
-
Yes I wonder about is there a standart java library for that thing.Yavuz– Yavuz2013-02-28 08:01:11 +00:00Commented Feb 28, 2013 at 8:01
-
See also stackoverflow.com/questions/8729808/… and reference to Unsafe.assylias– assylias2013-02-28 08:05:14 +00:00Commented Feb 28, 2013 at 8:05
Add a comment
|
2 Answers
See MappedByteBuffer. It's the standard Java class to read & write shared memory. I use it a lot. Yes, you can use this to communicate with any program written in any language which uses shared memory, and it's all very standard Java, no JNI.