public static native long bytes_to_u8_vec(byte[] bytes);
public static native long new_txpointer_copy_data(byte[] txdata);
public static native void txpointer_free(long ptr);
+ public static native byte[] txpointer_get_buffer(long ptr);
public static native long vec_slice_len(long vec);
public static native long new_empty_slice_vec();
(*_env)->GetByteArrayRegion (_env, bytes, 0, vec->datalen, vec->data);
return (long)vec;
}
+JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_txpointer_1get_1buffer (JNIEnv * env, jclass _b, jlong ptr) {
+ LDKTransaction *txdata = (LDKTransaction*)ptr;
+ LDKu8slice slice;
+ slice.data = txdata->data;
+ slice.datalen = txdata->datalen;
+ return Java_org_ldk_impl_bindings_get_1u8_1slice_1bytes(env, _b, (long)&slice);
+}
JNIEXPORT long JNICALL Java_org_ldk_impl_bindings_new_1txpointer_1copy_1data (JNIEnv * env, jclass _b, jbyteArray bytes) {
LDKTransaction *txdata = (LDKTransaction*)MALLOC(sizeof(LDKTransaction), "LDKTransaction");
txdata->datalen = (*env)->GetArrayLength(env, bytes);
out_java_struct.write("\tTransaction(java.lang.Object _dummy, long ptr) { super(ptr); }\n")
out_java_struct.write("\tpublic Transaction(byte[] data) { super(bindings.new_txpointer_copy_data(data)); }\n")
out_java_struct.write("\t@Override public void finalize() throws Throwable { super.finalize(); bindings.txpointer_free(ptr); }\n")
+ out_java_struct.write("\tpublic byte[] get_contents() { return bindings.txpointer_get_buffer(ptr); }\n")
# TODO: Transaction body
out_java_struct.write("}")
else:
public static native long bytes_to_u8_vec(byte[] bytes);
public static native long new_txpointer_copy_data(byte[] txdata);
public static native void txpointer_free(long ptr);
+ public static native byte[] txpointer_get_buffer(long ptr);
public static native long vec_slice_len(long vec);
public static native long new_empty_slice_vec();
Transaction(java.lang.Object _dummy, long ptr) { super(ptr); }
public Transaction(byte[] data) { super(bindings.new_txpointer_copy_data(data)); }
@Override public void finalize() throws Throwable { super.finalize(); bindings.txpointer_free(ptr); }
+ public byte[] get_contents() { return bindings.txpointer_get_buffer(ptr); }
}
\ No newline at end of file
(*_env)->GetByteArrayRegion (_env, bytes, 0, vec->datalen, vec->data);
return (long)vec;
}
+JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_txpointer_1get_1buffer (JNIEnv * env, jclass _b, jlong ptr) {
+ LDKTransaction *txdata = (LDKTransaction*)ptr;
+ LDKu8slice slice;
+ slice.data = txdata->data;
+ slice.datalen = txdata->datalen;
+ return Java_org_ldk_impl_bindings_get_1u8_1slice_1bytes(env, _b, (long)&slice);
+}
JNIEXPORT long JNICALL Java_org_ldk_impl_bindings_new_1txpointer_1copy_1data (JNIEnv * env, jclass _b, jbyteArray bytes) {
LDKTransaction *txdata = (LDKTransaction*)MALLOC(sizeof(LDKTransaction), "LDKTransaction");
txdata->datalen = (*env)->GetArrayLength(env, bytes);
JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_txpointer_1free
(JNIEnv *, jclass, jlong);
+/*
+ * Class: org_ldk_impl_bindings
+ * Method: txpointer_get_buffer
+ * Signature: (J)[B
+ */
+JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_txpointer_1get_1buffer
+ (JNIEnv *, jclass, jlong);
+
/*
* Class: org_ldk_impl_bindings
* Method: vec_slice_len