10

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.

4
  • 1
    To use native memory without using native interface? Commented Feb 28, 2013 at 7:58
  • Access to off heap memory could be the answer. Commented Feb 28, 2013 at 8:01
  • Yes I wonder about is there a standart java library for that thing. Commented Feb 28, 2013 at 8:01
  • See also stackoverflow.com/questions/8729808/… and reference to Unsafe. Commented Feb 28, 2013 at 8:05

2 Answers 2

5

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.

Sign up to request clarification or add additional context in comments.

Comments

1

Yes, you can use code project :code project

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.