Created
November 9, 2015 11:05
-
-
Save 0xF6/2b4c86f1b8130425c83e to your computer and use it in GitHub Desktop.
CLR Byte Array to JNI byte Array
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
jbyteArray toJByteArray(JNIEnv * pEnv, array<byte>^ arr) | |
{ | |
jbyteArray jab = pEnv->NewByteArray(arr->Length); | |
pin_ptr<unsigned char> pUnmanagedArr = &arr[0]; | |
pEnv->SetByteArrayRegion(jab, 0, arr->Length , (jbyte*)pUnmanagedArr); | |
return jab; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment