-JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKCVecTempl_1Transaction_1new(JNIEnv *env, jclass _b, jlongArray elems){
- LDKCVecTempl_Transaction *ret = MALLOC(sizeof(LDKCVecTempl_Transaction), "LDKCVecTempl_Transaction");
- ret->datalen = (*env)->GetArrayLength(env, elems);
- if (ret->datalen == 0) {
- ret->data = NULL;
- } else {
- ret->data = MALLOC(sizeof(LDKTransaction) * ret->datalen, "LDKCVecTempl_Transaction Data");
- jlong *java_elems = (*env)->GetPrimitiveArrayCritical(env, elems, NULL);
- for (size_t i = 0; i < ret->datalen; i++) {
- jlong arr_elem = java_elems[i];
- LDKTransaction arr_elem_conv = *(LDKTransaction*)arr_elem;
- ret->data[i] = arr_elem_conv;
- }
- (*env)->ReleasePrimitiveArrayCritical(env, elems, java_elems, 0);
- }
- return (long)ret;
-}