Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

how to convert Mat to jbyteArray ??

I have to return a jbyteArray (I'm using JNI and want a byte[] to return to the Java part). I have a native function in java with return type byte[].

I have an image in Mat and i have to convert it into jbyteArray so as to return it to my java code, and I don't know what it's the best approach.

click to hide/show revision 2
retagged

updated 2016-12-27 01:52:03 -0600

berak gravatar image

how to convert Mat to jbyteArray ??

I have to return a jbyteArray (I'm using JNI and want a byte[] to return to the Java part). I have a native function in java with return type byte[].

I have an image in Mat and i have to convert it into jbyteArray so as to return it to my java code, and I don't know what it's the best approach.