+JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_RoutingMessageHandler_1free(JNIEnv * _env, jclass _b, jlong this_ptr) {
+ LDKRoutingMessageHandler this_ptr_conv = *(LDKRoutingMessageHandler*)this_ptr;
+ FREE((void*)this_ptr);
+ RoutingMessageHandler_free(this_ptr_conv);
+}
+
+JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_AcceptChannel_1write(JNIEnv * _env, jclass _b, jlong obj) {
+ LDKAcceptChannel obj_conv;
+ obj_conv.inner = (void*)(obj & (~1));
+ obj_conv.is_owned = false;
+ LDKCVec_u8Z arg_var = AcceptChannel_write(&obj_conv);
+ jbyteArray arg_arr = (*_env)->NewByteArray(_env, arg_var.datalen);
+ (*_env)->SetByteArrayRegion(_env, arg_arr, 0, arg_var.datalen, arg_var.data);
+ CVec_u8Z_free(arg_var);
+ return arg_arr;
+}
+
+JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_AcceptChannel_1read(JNIEnv * _env, jclass _b, jbyteArray ser) {
+ LDKu8slice ser_ref;
+ ser_ref.datalen = (*_env)->GetArrayLength (_env, ser);
+ ser_ref.data = (*_env)->GetByteArrayElements (_env, ser, NULL);
+ LDKAcceptChannel ret_var = AcceptChannel_read(ser_ref);
+ CHECK((((long)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
+ CHECK((((long)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
+ long ret_ref = (long)ret_var.inner;
+ if (ret_var.is_owned) {
+ ret_ref |= 1;
+ }
+ (*_env)->ReleaseByteArrayElements(_env, ser, (int8_t*)ser_ref.data, 0);
+ return ret_ref;
+}
+
+JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_AnnouncementSignatures_1write(JNIEnv * _env, jclass _b, jlong obj) {
+ LDKAnnouncementSignatures obj_conv;
+ obj_conv.inner = (void*)(obj & (~1));
+ obj_conv.is_owned = false;
+ LDKCVec_u8Z arg_var = AnnouncementSignatures_write(&obj_conv);
+ jbyteArray arg_arr = (*_env)->NewByteArray(_env, arg_var.datalen);
+ (*_env)->SetByteArrayRegion(_env, arg_arr, 0, arg_var.datalen, arg_var.data);
+ CVec_u8Z_free(arg_var);
+ return arg_arr;
+}
+
+JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_AnnouncementSignatures_1read(JNIEnv * _env, jclass _b, jbyteArray ser) {
+ LDKu8slice ser_ref;
+ ser_ref.datalen = (*_env)->GetArrayLength (_env, ser);
+ ser_ref.data = (*_env)->GetByteArrayElements (_env, ser, NULL);
+ LDKAnnouncementSignatures ret_var = AnnouncementSignatures_read(ser_ref);
+ CHECK((((long)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
+ CHECK((((long)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
+ long ret_ref = (long)ret_var.inner;
+ if (ret_var.is_owned) {
+ ret_ref |= 1;
+ }
+ (*_env)->ReleaseByteArrayElements(_env, ser, (int8_t*)ser_ref.data, 0);
+ return ret_ref;
+}
+
+JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_ChannelReestablish_1write(JNIEnv * _env, jclass _b, jlong obj) {
+ LDKChannelReestablish obj_conv;
+ obj_conv.inner = (void*)(obj & (~1));
+ obj_conv.is_owned = false;
+ LDKCVec_u8Z arg_var = ChannelReestablish_write(&obj_conv);
+ jbyteArray arg_arr = (*_env)->NewByteArray(_env, arg_var.datalen);
+ (*_env)->SetByteArrayRegion(_env, arg_arr, 0, arg_var.datalen, arg_var.data);
+ CVec_u8Z_free(arg_var);
+ return arg_arr;
+}
+
+JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelReestablish_1read(JNIEnv * _env, jclass _b, jbyteArray ser) {
+ LDKu8slice ser_ref;
+ ser_ref.datalen = (*_env)->GetArrayLength (_env, ser);
+ ser_ref.data = (*_env)->GetByteArrayElements (_env, ser, NULL);
+ LDKCResult_ChannelReestablishDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelReestablishDecodeErrorZ), "LDKCResult_ChannelReestablishDecodeErrorZ");
+ *ret_conv = ChannelReestablish_read(ser_ref);
+ (*_env)->ReleaseByteArrayElements(_env, ser, (int8_t*)ser_ref.data, 0);
+ return (long)ret_conv;
+}
+
+JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_ClosingSigned_1write(JNIEnv * _env, jclass _b, jlong obj) {
+ LDKClosingSigned obj_conv;
+ obj_conv.inner = (void*)(obj & (~1));
+ obj_conv.is_owned = false;
+ LDKCVec_u8Z arg_var = ClosingSigned_write(&obj_conv);
+ jbyteArray arg_arr = (*_env)->NewByteArray(_env, arg_var.datalen);
+ (*_env)->SetByteArrayRegion(_env, arg_arr, 0, arg_var.datalen, arg_var.data);
+ CVec_u8Z_free(arg_var);
+ return arg_arr;
+}
+
+JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ClosingSigned_1read(JNIEnv * _env, jclass _b, jbyteArray ser) {
+ LDKu8slice ser_ref;
+ ser_ref.datalen = (*_env)->GetArrayLength (_env, ser);
+ ser_ref.data = (*_env)->GetByteArrayElements (_env, ser, NULL);
+ LDKClosingSigned ret_var = ClosingSigned_read(ser_ref);
+ CHECK((((long)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
+ CHECK((((long)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
+ long ret_ref = (long)ret_var.inner;
+ if (ret_var.is_owned) {
+ ret_ref |= 1;
+ }
+ (*_env)->ReleaseByteArrayElements(_env, ser, (int8_t*)ser_ref.data, 0);
+ return ret_ref;
+}
+
+JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_CommitmentSigned_1write(JNIEnv * _env, jclass _b, jlong obj) {
+ LDKCommitmentSigned obj_conv;
+ obj_conv.inner = (void*)(obj & (~1));
+ obj_conv.is_owned = false;
+ LDKCVec_u8Z arg_var = CommitmentSigned_write(&obj_conv);
+ jbyteArray arg_arr = (*_env)->NewByteArray(_env, arg_var.datalen);
+ (*_env)->SetByteArrayRegion(_env, arg_arr, 0, arg_var.datalen, arg_var.data);
+ CVec_u8Z_free(arg_var);
+ return arg_arr;
+}
+
+JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CommitmentSigned_1read(JNIEnv * _env, jclass _b, jbyteArray ser) {
+ LDKu8slice ser_ref;
+ ser_ref.datalen = (*_env)->GetArrayLength (_env, ser);
+ ser_ref.data = (*_env)->GetByteArrayElements (_env, ser, NULL);
+ LDKCommitmentSigned ret_var = CommitmentSigned_read(ser_ref);
+ CHECK((((long)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
+ CHECK((((long)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
+ long ret_ref = (long)ret_var.inner;
+ if (ret_var.is_owned) {
+ ret_ref |= 1;
+ }
+ (*_env)->ReleaseByteArrayElements(_env, ser, (int8_t*)ser_ref.data, 0);
+ return ret_ref;
+}
+
+JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_FundingCreated_1write(JNIEnv * _env, jclass _b, jlong obj) {
+ LDKFundingCreated obj_conv;
+ obj_conv.inner = (void*)(obj & (~1));
+ obj_conv.is_owned = false;
+ LDKCVec_u8Z arg_var = FundingCreated_write(&obj_conv);
+ jbyteArray arg_arr = (*_env)->NewByteArray(_env, arg_var.datalen);
+ (*_env)->SetByteArrayRegion(_env, arg_arr, 0, arg_var.datalen, arg_var.data);
+ CVec_u8Z_free(arg_var);
+ return arg_arr;
+}
+
+JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_FundingCreated_1read(JNIEnv * _env, jclass _b, jbyteArray ser) {
+ LDKu8slice ser_ref;
+ ser_ref.datalen = (*_env)->GetArrayLength (_env, ser);
+ ser_ref.data = (*_env)->GetByteArrayElements (_env, ser, NULL);
+ LDKFundingCreated ret_var = FundingCreated_read(ser_ref);
+ CHECK((((long)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
+ CHECK((((long)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
+ long ret_ref = (long)ret_var.inner;
+ if (ret_var.is_owned) {
+ ret_ref |= 1;
+ }
+ (*_env)->ReleaseByteArrayElements(_env, ser, (int8_t*)ser_ref.data, 0);
+ return ret_ref;
+}
+
+JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_FundingSigned_1write(JNIEnv * _env, jclass _b, jlong obj) {
+ LDKFundingSigned obj_conv;
+ obj_conv.inner = (void*)(obj & (~1));
+ obj_conv.is_owned = false;
+ LDKCVec_u8Z arg_var = FundingSigned_write(&obj_conv);
+ jbyteArray arg_arr = (*_env)->NewByteArray(_env, arg_var.datalen);
+ (*_env)->SetByteArrayRegion(_env, arg_arr, 0, arg_var.datalen, arg_var.data);
+ CVec_u8Z_free(arg_var);
+ return arg_arr;
+}
+
+JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_FundingSigned_1read(JNIEnv * _env, jclass _b, jbyteArray ser) {
+ LDKu8slice ser_ref;
+ ser_ref.datalen = (*_env)->GetArrayLength (_env, ser);
+ ser_ref.data = (*_env)->GetByteArrayElements (_env, ser, NULL);
+ LDKFundingSigned ret_var = FundingSigned_read(ser_ref);
+ CHECK((((long)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
+ CHECK((((long)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
+ long ret_ref = (long)ret_var.inner;
+ if (ret_var.is_owned) {
+ ret_ref |= 1;
+ }
+ (*_env)->ReleaseByteArrayElements(_env, ser, (int8_t*)ser_ref.data, 0);
+ return ret_ref;
+}
+
+JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_FundingLocked_1write(JNIEnv * _env, jclass _b, jlong obj) {
+ LDKFundingLocked obj_conv;
+ obj_conv.inner = (void*)(obj & (~1));
+ obj_conv.is_owned = false;
+ LDKCVec_u8Z arg_var = FundingLocked_write(&obj_conv);
+ jbyteArray arg_arr = (*_env)->NewByteArray(_env, arg_var.datalen);
+ (*_env)->SetByteArrayRegion(_env, arg_arr, 0, arg_var.datalen, arg_var.data);
+ CVec_u8Z_free(arg_var);
+ return arg_arr;
+}
+
+JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_FundingLocked_1read(JNIEnv * _env, jclass _b, jbyteArray ser) {
+ LDKu8slice ser_ref;
+ ser_ref.datalen = (*_env)->GetArrayLength (_env, ser);
+ ser_ref.data = (*_env)->GetByteArrayElements (_env, ser, NULL);
+ LDKFundingLocked ret_var = FundingLocked_read(ser_ref);
+ CHECK((((long)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
+ CHECK((((long)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
+ long ret_ref = (long)ret_var.inner;
+ if (ret_var.is_owned) {
+ ret_ref |= 1;
+ }
+ (*_env)->ReleaseByteArrayElements(_env, ser, (int8_t*)ser_ref.data, 0);
+ return ret_ref;
+}
+
+JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_Init_1write(JNIEnv * _env, jclass _b, jlong obj) {
+ LDKInit obj_conv;
+ obj_conv.inner = (void*)(obj & (~1));
+ obj_conv.is_owned = false;
+ LDKCVec_u8Z arg_var = Init_write(&obj_conv);
+ jbyteArray arg_arr = (*_env)->NewByteArray(_env, arg_var.datalen);
+ (*_env)->SetByteArrayRegion(_env, arg_arr, 0, arg_var.datalen, arg_var.data);
+ CVec_u8Z_free(arg_var);
+ return arg_arr;
+}
+
+JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_Init_1read(JNIEnv * _env, jclass _b, jbyteArray ser) {
+ LDKu8slice ser_ref;
+ ser_ref.datalen = (*_env)->GetArrayLength (_env, ser);
+ ser_ref.data = (*_env)->GetByteArrayElements (_env, ser, NULL);
+ LDKCResult_InitDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InitDecodeErrorZ), "LDKCResult_InitDecodeErrorZ");
+ *ret_conv = Init_read(ser_ref);
+ (*_env)->ReleaseByteArrayElements(_env, ser, (int8_t*)ser_ref.data, 0);
+ return (long)ret_conv;
+}
+
+JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_OpenChannel_1write(JNIEnv * _env, jclass _b, jlong obj) {
+ LDKOpenChannel obj_conv;
+ obj_conv.inner = (void*)(obj & (~1));
+ obj_conv.is_owned = false;
+ LDKCVec_u8Z arg_var = OpenChannel_write(&obj_conv);
+ jbyteArray arg_arr = (*_env)->NewByteArray(_env, arg_var.datalen);
+ (*_env)->SetByteArrayRegion(_env, arg_arr, 0, arg_var.datalen, arg_var.data);
+ CVec_u8Z_free(arg_var);
+ return arg_arr;
+}
+
+JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_OpenChannel_1read(JNIEnv * _env, jclass _b, jbyteArray ser) {
+ LDKu8slice ser_ref;
+ ser_ref.datalen = (*_env)->GetArrayLength (_env, ser);
+ ser_ref.data = (*_env)->GetByteArrayElements (_env, ser, NULL);
+ LDKOpenChannel ret_var = OpenChannel_read(ser_ref);
+ CHECK((((long)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
+ CHECK((((long)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
+ long ret_ref = (long)ret_var.inner;
+ if (ret_var.is_owned) {
+ ret_ref |= 1;
+ }
+ (*_env)->ReleaseByteArrayElements(_env, ser, (int8_t*)ser_ref.data, 0);
+ return ret_ref;
+}
+
+JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_RevokeAndACK_1write(JNIEnv * _env, jclass _b, jlong obj) {
+ LDKRevokeAndACK obj_conv;
+ obj_conv.inner = (void*)(obj & (~1));
+ obj_conv.is_owned = false;
+ LDKCVec_u8Z arg_var = RevokeAndACK_write(&obj_conv);
+ jbyteArray arg_arr = (*_env)->NewByteArray(_env, arg_var.datalen);
+ (*_env)->SetByteArrayRegion(_env, arg_arr, 0, arg_var.datalen, arg_var.data);
+ CVec_u8Z_free(arg_var);
+ return arg_arr;
+}
+
+JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_RevokeAndACK_1read(JNIEnv * _env, jclass _b, jbyteArray ser) {
+ LDKu8slice ser_ref;
+ ser_ref.datalen = (*_env)->GetArrayLength (_env, ser);
+ ser_ref.data = (*_env)->GetByteArrayElements (_env, ser, NULL);
+ LDKRevokeAndACK ret_var = RevokeAndACK_read(ser_ref);
+ CHECK((((long)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
+ CHECK((((long)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
+ long ret_ref = (long)ret_var.inner;
+ if (ret_var.is_owned) {
+ ret_ref |= 1;
+ }
+ (*_env)->ReleaseByteArrayElements(_env, ser, (int8_t*)ser_ref.data, 0);
+ return ret_ref;
+}
+
+JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_Shutdown_1write(JNIEnv * _env, jclass _b, jlong obj) {
+ LDKShutdown obj_conv;
+ obj_conv.inner = (void*)(obj & (~1));
+ obj_conv.is_owned = false;
+ LDKCVec_u8Z arg_var = Shutdown_write(&obj_conv);
+ jbyteArray arg_arr = (*_env)->NewByteArray(_env, arg_var.datalen);
+ (*_env)->SetByteArrayRegion(_env, arg_arr, 0, arg_var.datalen, arg_var.data);
+ CVec_u8Z_free(arg_var);
+ return arg_arr;
+}
+
+JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_Shutdown_1read(JNIEnv * _env, jclass _b, jbyteArray ser) {
+ LDKu8slice ser_ref;
+ ser_ref.datalen = (*_env)->GetArrayLength (_env, ser);
+ ser_ref.data = (*_env)->GetByteArrayElements (_env, ser, NULL);
+ LDKShutdown ret_var = Shutdown_read(ser_ref);
+ CHECK((((long)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
+ CHECK((((long)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
+ long ret_ref = (long)ret_var.inner;
+ if (ret_var.is_owned) {
+ ret_ref |= 1;
+ }
+ (*_env)->ReleaseByteArrayElements(_env, ser, (int8_t*)ser_ref.data, 0);
+ return ret_ref;
+}
+
+JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_UpdateFailHTLC_1write(JNIEnv * _env, jclass _b, jlong obj) {
+ LDKUpdateFailHTLC obj_conv;
+ obj_conv.inner = (void*)(obj & (~1));
+ obj_conv.is_owned = false;
+ LDKCVec_u8Z arg_var = UpdateFailHTLC_write(&obj_conv);
+ jbyteArray arg_arr = (*_env)->NewByteArray(_env, arg_var.datalen);
+ (*_env)->SetByteArrayRegion(_env, arg_arr, 0, arg_var.datalen, arg_var.data);
+ CVec_u8Z_free(arg_var);
+ return arg_arr;
+}
+
+JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_UpdateFailHTLC_1read(JNIEnv * _env, jclass _b, jbyteArray ser) {
+ LDKu8slice ser_ref;
+ ser_ref.datalen = (*_env)->GetArrayLength (_env, ser);
+ ser_ref.data = (*_env)->GetByteArrayElements (_env, ser, NULL);
+ LDKUpdateFailHTLC ret_var = UpdateFailHTLC_read(ser_ref);
+ CHECK((((long)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
+ CHECK((((long)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
+ long ret_ref = (long)ret_var.inner;
+ if (ret_var.is_owned) {
+ ret_ref |= 1;
+ }
+ (*_env)->ReleaseByteArrayElements(_env, ser, (int8_t*)ser_ref.data, 0);
+ return ret_ref;
+}
+
+JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_UpdateFailMalformedHTLC_1write(JNIEnv * _env, jclass _b, jlong obj) {
+ LDKUpdateFailMalformedHTLC obj_conv;
+ obj_conv.inner = (void*)(obj & (~1));
+ obj_conv.is_owned = false;
+ LDKCVec_u8Z arg_var = UpdateFailMalformedHTLC_write(&obj_conv);
+ jbyteArray arg_arr = (*_env)->NewByteArray(_env, arg_var.datalen);
+ (*_env)->SetByteArrayRegion(_env, arg_arr, 0, arg_var.datalen, arg_var.data);
+ CVec_u8Z_free(arg_var);
+ return arg_arr;
+}
+
+JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_UpdateFailMalformedHTLC_1read(JNIEnv * _env, jclass _b, jbyteArray ser) {
+ LDKu8slice ser_ref;
+ ser_ref.datalen = (*_env)->GetArrayLength (_env, ser);
+ ser_ref.data = (*_env)->GetByteArrayElements (_env, ser, NULL);
+ LDKUpdateFailMalformedHTLC ret_var = UpdateFailMalformedHTLC_read(ser_ref);
+ CHECK((((long)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
+ CHECK((((long)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
+ long ret_ref = (long)ret_var.inner;
+ if (ret_var.is_owned) {
+ ret_ref |= 1;
+ }
+ (*_env)->ReleaseByteArrayElements(_env, ser, (int8_t*)ser_ref.data, 0);
+ return ret_ref;
+}
+
+JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_UpdateFee_1write(JNIEnv * _env, jclass _b, jlong obj) {
+ LDKUpdateFee obj_conv;
+ obj_conv.inner = (void*)(obj & (~1));
+ obj_conv.is_owned = false;
+ LDKCVec_u8Z arg_var = UpdateFee_write(&obj_conv);
+ jbyteArray arg_arr = (*_env)->NewByteArray(_env, arg_var.datalen);
+ (*_env)->SetByteArrayRegion(_env, arg_arr, 0, arg_var.datalen, arg_var.data);
+ CVec_u8Z_free(arg_var);
+ return arg_arr;
+}
+
+JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_UpdateFee_1read(JNIEnv * _env, jclass _b, jbyteArray ser) {
+ LDKu8slice ser_ref;
+ ser_ref.datalen = (*_env)->GetArrayLength (_env, ser);
+ ser_ref.data = (*_env)->GetByteArrayElements (_env, ser, NULL);
+ LDKUpdateFee ret_var = UpdateFee_read(ser_ref);
+ CHECK((((long)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
+ CHECK((((long)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
+ long ret_ref = (long)ret_var.inner;
+ if (ret_var.is_owned) {
+ ret_ref |= 1;
+ }
+ (*_env)->ReleaseByteArrayElements(_env, ser, (int8_t*)ser_ref.data, 0);
+ return ret_ref;
+}
+
+JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_UpdateFulfillHTLC_1write(JNIEnv * _env, jclass _b, jlong obj) {
+ LDKUpdateFulfillHTLC obj_conv;
+ obj_conv.inner = (void*)(obj & (~1));
+ obj_conv.is_owned = false;
+ LDKCVec_u8Z arg_var = UpdateFulfillHTLC_write(&obj_conv);
+ jbyteArray arg_arr = (*_env)->NewByteArray(_env, arg_var.datalen);
+ (*_env)->SetByteArrayRegion(_env, arg_arr, 0, arg_var.datalen, arg_var.data);
+ CVec_u8Z_free(arg_var);
+ return arg_arr;
+}
+
+JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_UpdateFulfillHTLC_1read(JNIEnv * _env, jclass _b, jbyteArray ser) {
+ LDKu8slice ser_ref;
+ ser_ref.datalen = (*_env)->GetArrayLength (_env, ser);
+ ser_ref.data = (*_env)->GetByteArrayElements (_env, ser, NULL);
+ LDKUpdateFulfillHTLC ret_var = UpdateFulfillHTLC_read(ser_ref);
+ CHECK((((long)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
+ CHECK((((long)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
+ long ret_ref = (long)ret_var.inner;
+ if (ret_var.is_owned) {
+ ret_ref |= 1;
+ }
+ (*_env)->ReleaseByteArrayElements(_env, ser, (int8_t*)ser_ref.data, 0);
+ return ret_ref;
+}
+
+JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_UpdateAddHTLC_1write(JNIEnv * _env, jclass _b, jlong obj) {
+ LDKUpdateAddHTLC obj_conv;
+ obj_conv.inner = (void*)(obj & (~1));
+ obj_conv.is_owned = false;
+ LDKCVec_u8Z arg_var = UpdateAddHTLC_write(&obj_conv);
+ jbyteArray arg_arr = (*_env)->NewByteArray(_env, arg_var.datalen);
+ (*_env)->SetByteArrayRegion(_env, arg_arr, 0, arg_var.datalen, arg_var.data);
+ CVec_u8Z_free(arg_var);
+ return arg_arr;
+}
+
+JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_UpdateAddHTLC_1read(JNIEnv * _env, jclass _b, jbyteArray ser) {
+ LDKu8slice ser_ref;
+ ser_ref.datalen = (*_env)->GetArrayLength (_env, ser);
+ ser_ref.data = (*_env)->GetByteArrayElements (_env, ser, NULL);
+ LDKUpdateAddHTLC ret_var = UpdateAddHTLC_read(ser_ref);
+ CHECK((((long)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
+ CHECK((((long)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
+ long ret_ref = (long)ret_var.inner;
+ if (ret_var.is_owned) {
+ ret_ref |= 1;
+ }
+ (*_env)->ReleaseByteArrayElements(_env, ser, (int8_t*)ser_ref.data, 0);
+ return ret_ref;
+}
+
+JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_Ping_1write(JNIEnv * _env, jclass _b, jlong obj) {
+ LDKPing obj_conv;
+ obj_conv.inner = (void*)(obj & (~1));
+ obj_conv.is_owned = false;
+ LDKCVec_u8Z arg_var = Ping_write(&obj_conv);
+ jbyteArray arg_arr = (*_env)->NewByteArray(_env, arg_var.datalen);
+ (*_env)->SetByteArrayRegion(_env, arg_arr, 0, arg_var.datalen, arg_var.data);
+ CVec_u8Z_free(arg_var);
+ return arg_arr;
+}
+
+JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_Ping_1read(JNIEnv * _env, jclass _b, jbyteArray ser) {
+ LDKu8slice ser_ref;
+ ser_ref.datalen = (*_env)->GetArrayLength (_env, ser);
+ ser_ref.data = (*_env)->GetByteArrayElements (_env, ser, NULL);
+ LDKCResult_PingDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PingDecodeErrorZ), "LDKCResult_PingDecodeErrorZ");
+ *ret_conv = Ping_read(ser_ref);
+ (*_env)->ReleaseByteArrayElements(_env, ser, (int8_t*)ser_ref.data, 0);
+ return (long)ret_conv;
+}
+
+JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_Pong_1write(JNIEnv * _env, jclass _b, jlong obj) {
+ LDKPong obj_conv;
+ obj_conv.inner = (void*)(obj & (~1));
+ obj_conv.is_owned = false;
+ LDKCVec_u8Z arg_var = Pong_write(&obj_conv);
+ jbyteArray arg_arr = (*_env)->NewByteArray(_env, arg_var.datalen);
+ (*_env)->SetByteArrayRegion(_env, arg_arr, 0, arg_var.datalen, arg_var.data);
+ CVec_u8Z_free(arg_var);
+ return arg_arr;
+}
+
+JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_Pong_1read(JNIEnv * _env, jclass _b, jbyteArray ser) {
+ LDKu8slice ser_ref;
+ ser_ref.datalen = (*_env)->GetArrayLength (_env, ser);
+ ser_ref.data = (*_env)->GetByteArrayElements (_env, ser, NULL);
+ LDKCResult_PongDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PongDecodeErrorZ), "LDKCResult_PongDecodeErrorZ");
+ *ret_conv = Pong_read(ser_ref);
+ (*_env)->ReleaseByteArrayElements(_env, ser, (int8_t*)ser_ref.data, 0);
+ return (long)ret_conv;
+}
+
+JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_UnsignedChannelAnnouncement_1write(JNIEnv * _env, jclass _b, jlong obj) {
+ LDKUnsignedChannelAnnouncement obj_conv;
+ obj_conv.inner = (void*)(obj & (~1));
+ obj_conv.is_owned = false;
+ LDKCVec_u8Z arg_var = UnsignedChannelAnnouncement_write(&obj_conv);
+ jbyteArray arg_arr = (*_env)->NewByteArray(_env, arg_var.datalen);
+ (*_env)->SetByteArrayRegion(_env, arg_arr, 0, arg_var.datalen, arg_var.data);
+ CVec_u8Z_free(arg_var);
+ return arg_arr;
+}
+
+JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_UnsignedChannelAnnouncement_1read(JNIEnv * _env, jclass _b, jbyteArray ser) {
+ LDKu8slice ser_ref;
+ ser_ref.datalen = (*_env)->GetArrayLength (_env, ser);
+ ser_ref.data = (*_env)->GetByteArrayElements (_env, ser, NULL);
+ LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ), "LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ");
+ *ret_conv = UnsignedChannelAnnouncement_read(ser_ref);
+ (*_env)->ReleaseByteArrayElements(_env, ser, (int8_t*)ser_ref.data, 0);
+ return (long)ret_conv;
+}
+
+JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_ChannelAnnouncement_1write(JNIEnv * _env, jclass _b, jlong obj) {
+ LDKChannelAnnouncement obj_conv;
+ obj_conv.inner = (void*)(obj & (~1));
+ obj_conv.is_owned = false;
+ LDKCVec_u8Z arg_var = ChannelAnnouncement_write(&obj_conv);
+ jbyteArray arg_arr = (*_env)->NewByteArray(_env, arg_var.datalen);
+ (*_env)->SetByteArrayRegion(_env, arg_arr, 0, arg_var.datalen, arg_var.data);
+ CVec_u8Z_free(arg_var);
+ return arg_arr;
+}
+
+JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelAnnouncement_1read(JNIEnv * _env, jclass _b, jbyteArray ser) {
+ LDKu8slice ser_ref;
+ ser_ref.datalen = (*_env)->GetArrayLength (_env, ser);
+ ser_ref.data = (*_env)->GetByteArrayElements (_env, ser, NULL);
+ LDKChannelAnnouncement ret_var = ChannelAnnouncement_read(ser_ref);
+ CHECK((((long)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
+ CHECK((((long)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
+ long ret_ref = (long)ret_var.inner;
+ if (ret_var.is_owned) {
+ ret_ref |= 1;
+ }
+ (*_env)->ReleaseByteArrayElements(_env, ser, (int8_t*)ser_ref.data, 0);
+ return ret_ref;
+}
+
+JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_UnsignedChannelUpdate_1write(JNIEnv * _env, jclass _b, jlong obj) {
+ LDKUnsignedChannelUpdate obj_conv;
+ obj_conv.inner = (void*)(obj & (~1));
+ obj_conv.is_owned = false;
+ LDKCVec_u8Z arg_var = UnsignedChannelUpdate_write(&obj_conv);
+ jbyteArray arg_arr = (*_env)->NewByteArray(_env, arg_var.datalen);
+ (*_env)->SetByteArrayRegion(_env, arg_arr, 0, arg_var.datalen, arg_var.data);
+ CVec_u8Z_free(arg_var);
+ return arg_arr;
+}
+
+JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_UnsignedChannelUpdate_1read(JNIEnv * _env, jclass _b, jbyteArray ser) {
+ LDKu8slice ser_ref;
+ ser_ref.datalen = (*_env)->GetArrayLength (_env, ser);
+ ser_ref.data = (*_env)->GetByteArrayElements (_env, ser, NULL);
+ LDKCResult_UnsignedChannelUpdateDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_UnsignedChannelUpdateDecodeErrorZ), "LDKCResult_UnsignedChannelUpdateDecodeErrorZ");
+ *ret_conv = UnsignedChannelUpdate_read(ser_ref);
+ (*_env)->ReleaseByteArrayElements(_env, ser, (int8_t*)ser_ref.data, 0);
+ return (long)ret_conv;
+}
+
+JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_ChannelUpdate_1write(JNIEnv * _env, jclass _b, jlong obj) {
+ LDKChannelUpdate obj_conv;
+ obj_conv.inner = (void*)(obj & (~1));
+ obj_conv.is_owned = false;
+ LDKCVec_u8Z arg_var = ChannelUpdate_write(&obj_conv);
+ jbyteArray arg_arr = (*_env)->NewByteArray(_env, arg_var.datalen);
+ (*_env)->SetByteArrayRegion(_env, arg_arr, 0, arg_var.datalen, arg_var.data);
+ CVec_u8Z_free(arg_var);
+ return arg_arr;
+}
+
+JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelUpdate_1read(JNIEnv * _env, jclass _b, jbyteArray ser) {
+ LDKu8slice ser_ref;
+ ser_ref.datalen = (*_env)->GetArrayLength (_env, ser);
+ ser_ref.data = (*_env)->GetByteArrayElements (_env, ser, NULL);
+ LDKChannelUpdate ret_var = ChannelUpdate_read(ser_ref);
+ CHECK((((long)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
+ CHECK((((long)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
+ long ret_ref = (long)ret_var.inner;
+ if (ret_var.is_owned) {
+ ret_ref |= 1;
+ }
+ (*_env)->ReleaseByteArrayElements(_env, ser, (int8_t*)ser_ref.data, 0);
+ return ret_ref;
+}
+
+JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_ErrorMessage_1write(JNIEnv * _env, jclass _b, jlong obj) {
+ LDKErrorMessage obj_conv;
+ obj_conv.inner = (void*)(obj & (~1));
+ obj_conv.is_owned = false;
+ LDKCVec_u8Z arg_var = ErrorMessage_write(&obj_conv);
+ jbyteArray arg_arr = (*_env)->NewByteArray(_env, arg_var.datalen);
+ (*_env)->SetByteArrayRegion(_env, arg_arr, 0, arg_var.datalen, arg_var.data);
+ CVec_u8Z_free(arg_var);
+ return arg_arr;
+}
+
+JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ErrorMessage_1read(JNIEnv * _env, jclass _b, jbyteArray ser) {
+ LDKu8slice ser_ref;
+ ser_ref.datalen = (*_env)->GetArrayLength (_env, ser);
+ ser_ref.data = (*_env)->GetByteArrayElements (_env, ser, NULL);
+ LDKCResult_ErrorMessageDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ErrorMessageDecodeErrorZ), "LDKCResult_ErrorMessageDecodeErrorZ");
+ *ret_conv = ErrorMessage_read(ser_ref);
+ (*_env)->ReleaseByteArrayElements(_env, ser, (int8_t*)ser_ref.data, 0);
+ return (long)ret_conv;
+}
+
+JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_UnsignedNodeAnnouncement_1write(JNIEnv * _env, jclass _b, jlong obj) {
+ LDKUnsignedNodeAnnouncement obj_conv;
+ obj_conv.inner = (void*)(obj & (~1));
+ obj_conv.is_owned = false;
+ LDKCVec_u8Z arg_var = UnsignedNodeAnnouncement_write(&obj_conv);
+ jbyteArray arg_arr = (*_env)->NewByteArray(_env, arg_var.datalen);
+ (*_env)->SetByteArrayRegion(_env, arg_arr, 0, arg_var.datalen, arg_var.data);
+ CVec_u8Z_free(arg_var);
+ return arg_arr;
+}
+
+JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_UnsignedNodeAnnouncement_1read(JNIEnv * _env, jclass _b, jbyteArray ser) {
+ LDKu8slice ser_ref;
+ ser_ref.datalen = (*_env)->GetArrayLength (_env, ser);
+ ser_ref.data = (*_env)->GetByteArrayElements (_env, ser, NULL);
+ LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ), "LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ");
+ *ret_conv = UnsignedNodeAnnouncement_read(ser_ref);
+ (*_env)->ReleaseByteArrayElements(_env, ser, (int8_t*)ser_ref.data, 0);
+ return (long)ret_conv;
+}
+
+JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_NodeAnnouncement_1write(JNIEnv * _env, jclass _b, jlong obj) {
+ LDKNodeAnnouncement obj_conv;
+ obj_conv.inner = (void*)(obj & (~1));
+ obj_conv.is_owned = false;
+ LDKCVec_u8Z arg_var = NodeAnnouncement_write(&obj_conv);
+ jbyteArray arg_arr = (*_env)->NewByteArray(_env, arg_var.datalen);
+ (*_env)->SetByteArrayRegion(_env, arg_arr, 0, arg_var.datalen, arg_var.data);
+ CVec_u8Z_free(arg_var);
+ return arg_arr;
+}
+
+JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_NodeAnnouncement_1read(JNIEnv * _env, jclass _b, jbyteArray ser) {
+ LDKu8slice ser_ref;
+ ser_ref.datalen = (*_env)->GetArrayLength (_env, ser);
+ ser_ref.data = (*_env)->GetByteArrayElements (_env, ser, NULL);
+ LDKNodeAnnouncement ret_var = NodeAnnouncement_read(ser_ref);
+ CHECK((((long)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
+ CHECK((((long)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
+ long ret_ref = (long)ret_var.inner;
+ if (ret_var.is_owned) {
+ ret_ref |= 1;
+ }
+ (*_env)->ReleaseByteArrayElements(_env, ser, (int8_t*)ser_ref.data, 0);
+ return ret_ref;
+}
+
+JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_QueryShortChannelIds_1read(JNIEnv * _env, jclass _b, jbyteArray ser) {
+ LDKu8slice ser_ref;
+ ser_ref.datalen = (*_env)->GetArrayLength (_env, ser);
+ ser_ref.data = (*_env)->GetByteArrayElements (_env, ser, NULL);
+ LDKCResult_QueryShortChannelIdsDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_QueryShortChannelIdsDecodeErrorZ), "LDKCResult_QueryShortChannelIdsDecodeErrorZ");
+ *ret_conv = QueryShortChannelIds_read(ser_ref);
+ (*_env)->ReleaseByteArrayElements(_env, ser, (int8_t*)ser_ref.data, 0);
+ return (long)ret_conv;
+}
+
+JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_QueryShortChannelIds_1write(JNIEnv * _env, jclass _b, jlong obj) {
+ LDKQueryShortChannelIds obj_conv;
+ obj_conv.inner = (void*)(obj & (~1));
+ obj_conv.is_owned = false;
+ LDKCVec_u8Z arg_var = QueryShortChannelIds_write(&obj_conv);
+ jbyteArray arg_arr = (*_env)->NewByteArray(_env, arg_var.datalen);
+ (*_env)->SetByteArrayRegion(_env, arg_arr, 0, arg_var.datalen, arg_var.data);
+ CVec_u8Z_free(arg_var);
+ return arg_arr;
+}
+
+JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ReplyShortChannelIdsEnd_1read(JNIEnv * _env, jclass _b, jbyteArray ser) {
+ LDKu8slice ser_ref;
+ ser_ref.datalen = (*_env)->GetArrayLength (_env, ser);
+ ser_ref.data = (*_env)->GetByteArrayElements (_env, ser, NULL);
+ LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ), "LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ");
+ *ret_conv = ReplyShortChannelIdsEnd_read(ser_ref);
+ (*_env)->ReleaseByteArrayElements(_env, ser, (int8_t*)ser_ref.data, 0);
+ return (long)ret_conv;
+}
+
+JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_ReplyShortChannelIdsEnd_1write(JNIEnv * _env, jclass _b, jlong obj) {
+ LDKReplyShortChannelIdsEnd obj_conv;
+ obj_conv.inner = (void*)(obj & (~1));
+ obj_conv.is_owned = false;
+ LDKCVec_u8Z arg_var = ReplyShortChannelIdsEnd_write(&obj_conv);
+ jbyteArray arg_arr = (*_env)->NewByteArray(_env, arg_var.datalen);
+ (*_env)->SetByteArrayRegion(_env, arg_arr, 0, arg_var.datalen, arg_var.data);
+ CVec_u8Z_free(arg_var);
+ return arg_arr;
+}
+
+JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_QueryChannelRange_1read(JNIEnv * _env, jclass _b, jbyteArray ser) {
+ LDKu8slice ser_ref;
+ ser_ref.datalen = (*_env)->GetArrayLength (_env, ser);
+ ser_ref.data = (*_env)->GetByteArrayElements (_env, ser, NULL);
+ LDKCResult_QueryChannelRangeDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_QueryChannelRangeDecodeErrorZ), "LDKCResult_QueryChannelRangeDecodeErrorZ");
+ *ret_conv = QueryChannelRange_read(ser_ref);
+ (*_env)->ReleaseByteArrayElements(_env, ser, (int8_t*)ser_ref.data, 0);
+ return (long)ret_conv;
+}
+
+JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_QueryChannelRange_1write(JNIEnv * _env, jclass _b, jlong obj) {
+ LDKQueryChannelRange obj_conv;
+ obj_conv.inner = (void*)(obj & (~1));
+ obj_conv.is_owned = false;
+ LDKCVec_u8Z arg_var = QueryChannelRange_write(&obj_conv);
+ jbyteArray arg_arr = (*_env)->NewByteArray(_env, arg_var.datalen);
+ (*_env)->SetByteArrayRegion(_env, arg_arr, 0, arg_var.datalen, arg_var.data);
+ CVec_u8Z_free(arg_var);
+ return arg_arr;
+}
+
+JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ReplyChannelRange_1read(JNIEnv * _env, jclass _b, jbyteArray ser) {
+ LDKu8slice ser_ref;
+ ser_ref.datalen = (*_env)->GetArrayLength (_env, ser);
+ ser_ref.data = (*_env)->GetByteArrayElements (_env, ser, NULL);
+ LDKCResult_ReplyChannelRangeDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ReplyChannelRangeDecodeErrorZ), "LDKCResult_ReplyChannelRangeDecodeErrorZ");
+ *ret_conv = ReplyChannelRange_read(ser_ref);
+ (*_env)->ReleaseByteArrayElements(_env, ser, (int8_t*)ser_ref.data, 0);
+ return (long)ret_conv;
+}
+
+JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_ReplyChannelRange_1write(JNIEnv * _env, jclass _b, jlong obj) {
+ LDKReplyChannelRange obj_conv;
+ obj_conv.inner = (void*)(obj & (~1));
+ obj_conv.is_owned = false;
+ LDKCVec_u8Z arg_var = ReplyChannelRange_write(&obj_conv);
+ jbyteArray arg_arr = (*_env)->NewByteArray(_env, arg_var.datalen);
+ (*_env)->SetByteArrayRegion(_env, arg_arr, 0, arg_var.datalen, arg_var.data);
+ CVec_u8Z_free(arg_var);
+ return arg_arr;
+}
+
+JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_GossipTimestampFilter_1read(JNIEnv * _env, jclass _b, jbyteArray ser) {
+ LDKu8slice ser_ref;
+ ser_ref.datalen = (*_env)->GetArrayLength (_env, ser);
+ ser_ref.data = (*_env)->GetByteArrayElements (_env, ser, NULL);
+ LDKCResult_GossipTimestampFilterDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_GossipTimestampFilterDecodeErrorZ), "LDKCResult_GossipTimestampFilterDecodeErrorZ");
+ *ret_conv = GossipTimestampFilter_read(ser_ref);
+ (*_env)->ReleaseByteArrayElements(_env, ser, (int8_t*)ser_ref.data, 0);
+ return (long)ret_conv;
+}
+
+JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_GossipTimestampFilter_1write(JNIEnv * _env, jclass _b, jlong obj) {
+ LDKGossipTimestampFilter obj_conv;
+ obj_conv.inner = (void*)(obj & (~1));
+ obj_conv.is_owned = false;
+ LDKCVec_u8Z arg_var = GossipTimestampFilter_write(&obj_conv);
+ jbyteArray arg_arr = (*_env)->NewByteArray(_env, arg_var.datalen);
+ (*_env)->SetByteArrayRegion(_env, arg_arr, 0, arg_var.datalen, arg_var.data);
+ CVec_u8Z_free(arg_var);
+ return arg_arr;