Originally posted by Henry Wong:
Oh, I see what you are trying to do... you want to write to a stream on the Java side. And on the C++ side, you want to read from the stream to write the data out to the modem. Is this correct?
If this is true, I guess you can create a pair of piped streams (PipedInputStream and PipedOutputStreams) pass one end to the C++ side to read, and have Java write to the other end. You'll need to have separate thread as the C++ side should not return until the operation has completed.
Henry
That's not a bad idea but I wonder, performance-wise, how will it be? When you're talking about a Piped stream on the C++ side, I assume you mean doing the "env->GetMethodId(...) etc, stuff. Isn't that basically reflection? So I'd be taking a reflection hit on top of a JNI hit. Not saying that I have any alternative, but if there is one...
Thanks again. I'll be taking a look at that option and see if it works.