I have following code in c# and need similar functionality in java using JNA:
IntPtr pImage = SerializeByteArrayToIntPtr(imageData);
public static IntPtr SerializeByteArrayToIntPtr(byte[] arr)
{
IntPtr ptr = IntPtr.Zero;
if (arr != null && arr.Length > 0)
{
ptr = Marshal.AllocHGlobal(arr.Length);
Marshal.Copy(arr, 0, ptr, arr.Length);
}
return ptr;
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With