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.
asked Feb 28, 2013 at 7:55
Yavuz
1,4231 gold badge17 silver badges34 bronze badges
-
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
2 Answers 2
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.
Matthieu
3,1466 gold badges64 silver badges90 bronze badges
answered May 31, 2014 at 3:20
Tim Cooper
10.6k6 gold badges66 silver badges78 bronze badges
Sign up to request clarification or add additional context in comments.
Comments
Yes, you can use code project :code project
answered Feb 28, 2013 at 8:00
Addict
8232 gold badges9 silver badges16 bronze badges
Comments
Explore related questions
See similar questions with these tags.
default